This is an except from a question I posted.
I have a very simple command line .net application. I have reference to a .dll assembly and everything works just great when I run the program inside Visual Studio. However when I try to double click the .exe file or run it manually via DOS it errors out saying it doesn’t have access or can’t find my assembly reference.
What am I now understanding about this situation? Is it permission related or maybe I have to link the assembly reference in another way? I can’t find anything on web related to this one.
Here is a link to the answer that solved my problem.
The problem is that when the Executable is ran it access the Global Assembly Cache, which is not the case when ran in the IDE. That is why the project worked fine in debug mode, but not when I tried to run the Executable that Visual Studio created.
What you have to do is …
- Create an key file.
- Link that Key File to .Net .DLL project
- Install the .Net .DLL project into the GAC (Global Assembly Cache)
While this sounds simple I think it ended up being a bit tricky. If you run into problems feel free to post a question in the comment block and I’ll get back to ya.
In the end it was well worth the time to figure this out. Since now I have a external .DLL that manages all my Modeling Objects. I can link those Objects to any scheduled executables I create reducing the amount of duplicated code in a major way. Waahooo! Everything is now so clean and simple to manage!