Hello Brian,
thanks for the hint with the dbgview.exe. Meanwhile I got a workaround. Instead of instantiating TestDomain, I instantiate SimpleTestRunner. Now I can call my NUnit tests from LabVIEW (Yeah!!). But I would really like to know why I can't load an assembly in the TestDomain Runner. A console Application is running the tests, the same code in LabVIEW is not. To clarify things I added a zip file with a complete Test Project. The bin directory contains two TestRunners. They both run the tests in "NUnitTest.dll" and they both work. In the directory NUnitRunner_LV, there are two VIs ("NUnitSimpleTestRunner.vi" and "NUnitTestDomain.vi"). They do almost exactly the same as the console applications, but the TestDomain runner is not working. It brings up the earlier described exception.
I am using Windows XP, and tried it with LabVIEW 8.0.1 and 8.20
I found an article about .NET CAS on the code project: "
http://www.codeproject.com/dotnet/UB_CAS_NET.asp" maybe I can find a solution there. If you are interested and find something out, please let me know. But it is not really important to me anymore since I have a workaround.
Thanks for your help
Frank
Here is the complete exception message:
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark,
Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)
at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
at System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
at System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
at NUnit.Util.TestDomain.MakeRemoteTestRunner(AppDomain runnerDomain)
at NUnit.Util.TestDomain.Load(String assemblyFileName, String testFixture)
at NUnit.Util.TestDomain.Load(String assemblyFileName)
at Input3Module.Main(String[] argv) in C:\Dokumente und Einstellungen\Frank\Desktop\input3:line 8
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The first permission that failed was:
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Read="C:\Programme\NUnit 2.4 (Beta 1) for .Net 2.0\bin\nunit.core.dll"
PathDiscovery="C:\Programme\NUnit 2.4 (Beta 1) for .Net 2.0\bin\nunit.core.dll"/>
The demand was for:
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Read="C:\Programme\NUnit 2.4 (Beta 1) for .Net 2.0\bin\nunit.core.dll"
PathDiscovery="C:\Programme\NUnit 2.4 (Beta 1) for .Net 2.0\bin\nunit.core.dll"/>
The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1"/>
The assembly or AppDomain that failed was:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089