I have a very simple c开发者_运维百科ommand 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 or something it error 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.
Try copying the dll to the same folder as the exe if it is not already there. If the dll is being built in visual studio as part of the same project then make sure that both assemblies are being compiled (build all).
When VS runs an application directly it creates a different version of the application and not the one you would release. You'll notice yourapp.vshost.exe thats visual studio's one and not the one you should run.
精彩评论