Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Permissions.SecurityPermission
danius
#1 Posted : Wednesday, February 3, 2021 12:25:51 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/17/2013(UTC)
Posts: 20
Location: Ireland

Thanks: 3 times
Was thanked: 3 time(s) in 3 post(s)
Hi,

not sure what triggered this, but I have started seeing these issues when running unit tests for code that creates files on filesystem.
Granted I would assume it's my filesystem issue. but VS test runner (and live unit tests) works fine!

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Xunit
VS2017
Windows 2012 server
running in parallels machine.

nCrunch fails both in x64SateliteProcess/HostInsideIDE modes
And VS is running as local admin.

interstingly tests are able to create CSV files but not XLSX usingDocumentFormat.OpenXml;
I understand it's very specific use case, but one that might force me turn to MS live testing :(

Any tips?!

Thanks,
Daniel
Remco
#2 Posted : Wednesday, February 3, 2021 11:25:28 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Daniel,

Thanks for sharing this issue.

I'm not aware of anything in NCrunch that could directly cause this problem. The test environments we create default to full trust, and this looks like the kind of exception that could be thrown from partially trusted or constrained code.

Does this happen consistently for you? Or is it intermittent?

Check that there isn't a virus scanner involved here. They can do some strange things when it comes to security.

Can you try turning off the 'Track File Dependencies' setting? We're aware of some compatibility issues between this and isolated storage.

If you can isolate the issue in a sample project you can share with me (i.e. one that works with other runners but fails under NCrunch), I should be able to investigate further and hopefully provide some kind of resolution.

danius
#3 Posted : Friday, February 5, 2021 12:04:50 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/17/2013(UTC)
Posts: 20
Location: Ireland

Thanks: 3 times
Was thanked: 3 time(s) in 3 post(s)
Hi Remco,

thanks for coming back to me. "Track File Dependencies" applied to test project sorted it.

All back to normal again!

Thanks.

1 user thanked danius for this useful post.
Remco on 2/5/2021(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.031 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download