You can also use the .NET Assembly Task to reflect and execute public methods in your exe or dll.
So I setup a class library to wrap the code I want to call.
Then in VC I called the resulting dll in a .NET Assembly Task. However, when I run the dll's publicly exposed method that has my IOC wire up and references set to Copy Local = True I still can't run my assembly method.
Here is the error:
ExecuteProcess("D:\Program Files (x86)\VisualCron\\NETExecute40.exe" 104)->Execution error(s): Exception has been thrown by the target of an invocation. Could not load file or assembly 'NLog, Version=3.0.0.0, Culture=neutral, PublicKeyToken=xxx' or one of its dependencies. The system cannot find the file specified.
Exception in Task: ExecuteProcess("D:\Program Files (x86)\VisualCron\\NETExecute40.exe" 104)->Execution error(s): Exception has been thrown by the target of an invocation. Could not load file or assembly 'NLog, Version=3.0.0.0, Culture=neutral, PublicKeyToken=xxx' or one of its dependencies. The system cannot find the file specified.NLog is once of the references I am copying into my class library but NETExecute40.exe can't see it from the folder where the program dll is actually running:
D:\Projects\Consoles\Harvester\Harvester.dll
How do i fix this issue? Do I need to add NLog.dll and xml to the VC program files folder or create a system path?
Thanks.