Error executing .Net task - works in code editor however - VisualCron - Forum

Community forum

chris.hill@adsigroup.co.uk
2018-04-19T15:46:06Z
Hi

We have created a .Net task that communicates with a 3rd party API - it works fine when we run the code directly in the designer.

We had to add references after installing .Net Framework 4.7 to System.Net.Http, Systsem.Net.Http.Headers and System.IO using Add File and pointing at the file location directly - we didn't seem to have all these references by default?

The code compiles and executes when we click the run button in the code designer window, and returns the expected results.

However when we execute the task itself it fails always with an error (the dll name changes every time we compile) :

Exception in Task: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\TEMP\u4ij5duw.dll' or one of its dependencies. The system cannot find the file specified.
File name: 'file:///C:\Windows\TEMP\u4ij5duw.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
at VisualCronAPI.ReflectionHelper.GetModules(LangT lang, String strCode, List`1 lstReferencedAssemblies) in C:\sourcefiles\code\VisualCronAPI\APIPublic\ReflectionHelper.vb:line 1247
at VisualCronAPI.ReflectionHelper.RunCode(LangT lang, String strCode, String strMethod, List`1 listParams, Type& OutputType, List`1 lstReferencedAssemblies) in C:\sourcefiles\code\VisualCronAPI\APIPublic\ReflectionHelper.vb:line 1241
at OBOKIIHBDBPMCFALPGECCIFHCDJPEDKODDGK.EJNAIJCFFNMLEJKOEMCAFNHHJNOEOOPPBMNA.EALKKEBDBMLNCEEKMOGGKOMAEBKFLBONGFCN() in C:\sourcefiles\code\VisualCronService\Jobs\TaskProcesses\Reflection\clsProcessTaskDotNETExecute.vb:line 58

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Please help!
Support
2018-04-19T16:59:50Z
One thing the .NET Code Task is lacking is the ability to launch in a separate process. This can create a problem if you reference to external files. We will add this support. Meanwhile you can use Assembly Execute Task and create a Assembly instead.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2018-04-19T17:09:16Z
I see now that this has already been implemented. Try unchecking "Execute in server process"
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
chris.hill@adsigroup.co.uk
2018-04-20T07:26:35Z
That does seem to have solved the immediate issue - thanks!
Scroll to Top