0

I am building an agent service in C# to communicate with SCVMM installed on host. To do that the agent refers the following assemblies: Microsoft.SystemCenter.VirtualMachineManager.dll and Erros.dll etc.

In visual studio dev environment, I have added references to the agent app. When I build in debug/release mode basically I don't the above assemblies to be copied to debug/release directory, since the agent will distributed to customers. Basically agent app communicates with SCVMM, SCVMM must have been installed before installing the agent app.

One thing that I don't understand is how to make the agent service to refer Microsoft.SystemCenter.VirtualMachineManager.dll etc files that are already existing at <SCVMM root>/bin folder.

SLaks
  • 837,282
  • 173
  • 1,862
  • 1,933
Bala
  • 105
  • 1
  • 10

1 Answers1

1

Reference as normal in visual studio and before calling any method in the dll call :

AppDomain.CurrentDomain.AppendPrivatePath(scvmmroot + "/bin");

You could also do it in the yourapp.exe.config file (See Set Custom Path to Referenced DLL's? ) But as your path isn't relative to the executable that would mean generating the .config file in your installer.

Community
  • 1
  • 1
Julien Roncaglia
  • 16,859
  • 3
  • 57
  • 74