Changing the default path of a windows service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Environment: VS.Net 2003 FW 1.1 VB.Net

I have an application that uses reflection to load external assemblies. The
external assemblies reside in the same folder as the application exe. When I
run the application as a normal windows application, the external assemblies
are loaded just fine. When I run the application as a windows service, the
application expects the assemblies to be in the windows\system32 directory.

How can I change the assembly search path to look in the same directory as
the application exe and not windows\system32?


Thanks for the help...
 
RMB said:
Environment: VS.Net 2003 FW 1.1 VB.Net

I have an application that uses reflection to load external assemblies.
The
external assemblies reside in the same folder as the application exe. When
I
run the application as a normal windows application, the external
assemblies
are loaded just fine. When I run the application as a windows service,
the
application expects the assemblies to be in the windows\system32
directory.

How can I change the assembly search path to look in the same directory as
the application exe and not windows\system32?

System.Environment.CurrentDirectory =
System.AppDomain.CurrentDomain.BaseDirectory;
 
Back
Top