Ok , heres the thing. I have a project im workin on, and i have my exe , in a directory, with a subdirectory named DLL and inside that my dll.
I was sure that
csc /t:winexe /lib:DLL /r:uiobj.dll msf_exe.cs
is the compiler command i would use to create my exe, set up a DLL subdirectory and reference the dll inside it...
But alas when i run the exe and JiT Debugger error somes up saying System.IO.FileNotFound exception.... even though the command compiler does not have any error compiling the code.
It doesnt matter what i do , if i dont have my dll inside the folder with the exe it wont work. I can even add my dll to the GAC with gacutil.exe and that works fine. I just cant access my private dll's inside my subdirectory. Could it be that my environment vars are set wrong , or something else. i was sure that /:lib set a directory reference , but its just not working for me /cry :(
Any help or ideas would be great, thanks you in advance!
will cotterPosted Oct 18, 2008, 10:26 PM
Alas , i have figured it out , quite possibly it was just typos inside my config script
app.exe is inside application folder ... testa.dll and testb.dll are inside the DLL folder and program is now runnin on its own.
Thanks for pointing the direction once more :P
Question answered, Topic closed Big Grin.
will cotterPosted Oct 18, 2008, 8:14 PM
Ahah!. Yes you are correct , i have now read all the MSDN info on the CLR , but , i am still not sure what im doing with this config file.
I wrote a config file and when i launched the exe , it said there was an error in the config file itself .....
this is my current config file. Am i supposed to write anything with my app source code to make this happen?
Im sorry if i sound like a blundering idiot , but i have never had to use a config file , and i never had a reason to keep my dll's in a subdirectory before. But with this project , theres a lot of custom made dll's and its just a real big mess having them all in the main app folder.
Now as i said , i read over most everything @ MSDN , but at best , im still totally confused on how to write and set up my app, app.config and dll's.
Thanks for sending me in the right direction though :D.
AlanPosted Oct 18, 2008, 5:30 PM
The problem here is that the CLR doesn't use the same rules to find assemblies as the compiler does.
There's a mention of this in the MSDN reference for the /lib compiler switch which in turn links to an article entitled "How the Runtime Locates Assemblies":
http://msdn.microsoft.com/en-us/library/s5bac5fx(VS.80).aspx
However, the following article is a bit more readable:
http://kalpeshshirodker.wordpress.com/2007/09/06/specify-where-to-look-for-referenced-assemblies-in-c-application/
Personally, I can't be bothered with the application configuration file and so always copy my private dlls to the application folder.
will cotterPosted Oct 18, 2008, 2:57 PM
Daniel Innala AhlmarkPosted Oct 18, 2008, 2:55 PM