MatthewSteeples;14988 wrote:Hi Remco, does NCrunch load and execute the tests in an AppDomain at all? If so, it's potentially looking like a lack of "evidence" could be the problem. It looks like Isolated Storage uses the identity of the AppDomain to determine where to read and write data, so if this isn't set (as I believe it's optional) then it fails
Yes, we do. I wonder if this could be an issue. Here is what we do at the moment:
Code:
var setup = new AppDomainSetup
{
ApplicationName = "nCrunch.TestRunner_" + externalProcessid,
ApplicationBase = appDomainBaseDirectory,
ConfigurationFile = configFilePath
};
var evidence = new Evidence();
evidence.AddHost(new Zone(SecurityZone.MyComputer));
evidence.AddHost(new Url(typeof(TaskEnvironment).Assembly.CodeBase));
var appDomain = AppDomain.CreateDomain(
"nCrunch.TestRunner.AppDomain_" + externalProcessid,
evidence,
setup,
new PermissionSet(PermissionState.Unrestricted)
);
Do you see any issues here? I wonder if an option would be for you to create a new AppDomain in your test with the parameters that will allow the code to work.