views:

31

answers:

1

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 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.

A: 

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.

Alex
Well I follow your logic, however the defeats the purpose of me creating the external assembly. I have a large amount of command line object that for the most part use the same objects to do the work. Thus I don't want to have to copy the same .dll to each of the projects. Thus every time I update the assembly I would have to copy the .dll to every command line application. Is there no way to simple make the reference work? or to place the .dll file in a location common to all my command line projects??
Ryan
@Ryan then install the .dll in the GAChttp://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=713
Rune FS
That did it! One I linked the Assembly to the GAC that completely fixed it. I can't vote up this answer b/c I don't have enough rep points :(
Ryan