Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I specify an assembly's location?

Status
Not open for further replies.

McBugzz

Programmer
Sep 17, 2002
90
0
0
JP
Hi,

I've got an executable which depends on an assembly. The executable runs fine when the assembly sits right next to it in the same folder.

Is there a way to remove the assembly from the folder where the executable sits and put is somewhere else, without getting "System.IO.FileNotFoundException: Could not load file or assembly" on startup?

Thanks!
 
why would you not want to? this makes deployments, versioning, and updates very simple.

You can register assemblies in the GAC, but I find this makes deployment more complex and error prone.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
If I remember correctly, .NET checks an assembly from the ffg: %APP_PATH%, <root dir>, %windir%, %winsystem%, %PATH%, GAC. The order of searching I can't remember.

(am also wondering why you would want to move the assm)

hth [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top