Click here to Skip to main content
15,891,136 members
Home / Discussions / C#
   

C#

 
AnswerRe: Slight problem with my array program Pin
OriginalGriff4-Aug-19 19:24
mveOriginalGriff4-Aug-19 19:24 
QuestionGenerics overload Pin
Bernhard Hiller2-Aug-19 0:13
Bernhard Hiller2-Aug-19 0:13 
AnswerRe: Generics overload Pin
Richard Deeming2-Aug-19 1:56
mveRichard Deeming2-Aug-19 1:56 
GeneralRe: Generics overload Pin
Bernhard Hiller2-Aug-19 3:17
Bernhard Hiller2-Aug-19 3:17 
GeneralRe: Generics overload Pin
Richard Deeming2-Aug-19 3:38
mveRichard Deeming2-Aug-19 3:38 
GeneralRe: Generics overload Pin
Bernhard Hiller4-Aug-19 21:50
Bernhard Hiller4-Aug-19 21:50 
AnswerRe: Generics overload Pin
Gerry Schmitz2-Aug-19 5:36
mveGerry Schmitz2-Aug-19 5:36 
QuestionEmbedding resources with static directories Pin
Member 87627471-Aug-19 20:32
Member 87627471-Aug-19 20:32 
Hi all,

- I am very new to c# so please be easy on me -

I have this following code which works perfectly fine:

C#
string directory = Path.Combine(assemblyDirectory, "lib", "NetworkConnections");
            using (AssemblyCatalog assemblyCatalog = new AssemblyCatalog(typeof(NetworkConnectionsManager).Assembly))
             using (DirectoryCatalog directoryCatalog = new DirectoryCatalog(directory))
           
            using (AggregateCatalog aggregateCatalog = new AggregateCatalog(assemblyCatalog, directoryCatalog))
            {
                compositionContainer = new CompositionContainer(aggregateCatalog);
                networkConnectionsManager = compositionContainer.GetExportedValue<NetworkConnectionsManager>();
            } 

            networkConnectionsToUpstreamProxySettingsMap = networkConnectionsManager
                .GetAllConnectionFullNames()
                .ToDictionary(cn => cn, cn => networkConnectionsManager.GetCurrentProxySettingsForConnection(cn));
        }


(There are dll's located in ./lib/NetworkConnections)

Now I want to embed everything into a single exe. I used Fody Costura, which worked as expected as produced a single exe, but when I run my code I got an exception about lib/NetworkConnections/Telerik.NetworkConnections.dll file not found.

I tried changing the line to this instead:
C#
string directory = "/";


Which now gives a different exception:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

on this line:
.ToDictionary(cn => cn, cn => networkConnectionsManager.GetCurrentProxySettingsForConnection(cn));



is anyone able to help me as to what I am doing wrong? thank you so much in advance!
Questionadding double quote around variable add one backslash which causing issue Pin
Mou_kol31-Jul-19 5:54
Mou_kol31-Jul-19 5:54 
AnswerRe: adding double quote around variable add one backslash which causing issue Pin
OriginalGriff31-Jul-19 6:18
mveOriginalGriff31-Jul-19 6:18 
GeneralRe: adding double quote around variable add one backslash which causing issue Pin
Mou_kol31-Jul-19 21:25
Mou_kol31-Jul-19 21:25 
AnswerRe: adding double quote around variable add one backslash which causing issue Pin
Richard Deeming31-Jul-19 7:46
mveRichard Deeming31-Jul-19 7:46 
GeneralRe: adding double quote around variable add one backslash which causing issue Pin
Mou_kol31-Jul-19 21:30
Mou_kol31-Jul-19 21:30 
GeneralRe: adding double quote around variable add one backslash which causing issue Pin
Richard Deeming1-Aug-19 1:30
mveRichard Deeming1-Aug-19 1:30 
GeneralRe: adding double quote around variable add one backslash which causing issue Pin
Mou_kol1-Aug-19 5:44
Mou_kol1-Aug-19 5:44 
QuestionIs the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 7:19
professionalMSBassSinger30-Jul-19 7:19 
AnswerRe: Is the "using" statement really a good idea? Pin
Richard Deeming30-Jul-19 7:42
mveRichard Deeming30-Jul-19 7:42 
GeneralRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 8:05
professionalMSBassSinger30-Jul-19 8:05 
GeneralRe: Is the "using" statement really a good idea? Pin
Richard Deeming30-Jul-19 8:15
mveRichard Deeming30-Jul-19 8:15 
GeneralRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 8:26
professionalMSBassSinger30-Jul-19 8:26 
AnswerRe: Is the "using" statement really a good idea? Pin
Dave Kreskowiak30-Jul-19 8:03
mveDave Kreskowiak30-Jul-19 8:03 
GeneralRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 8:07
professionalMSBassSinger30-Jul-19 8:07 
GeneralRe: Is the "using" statement really a good idea? Pin
Dave Kreskowiak30-Jul-19 8:21
mveDave Kreskowiak30-Jul-19 8:21 
GeneralRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 8:47
professionalMSBassSinger30-Jul-19 8:47 
GeneralRe: Is the "using" statement really a good idea? Pin
Dave Kreskowiak30-Jul-19 13:16
mveDave Kreskowiak30-Jul-19 13:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.