Operation could destabilize the runtime?

前端 未结 11 1580
执念已碎
执念已碎 2020-11-28 09:31

I\'m having a little bit of trouble understanding what the problem is here. I have a bit of code that pulls records from a database using LINQ and puts them into an object

11条回答
  •  情话喂你
    2020-11-28 10:28

    I found this entry while looking for my own solution to "operation could destabilize the runtime". While the covariance/contra-variance advice above looks very interesting, in the end I found that I get the same error message by running my unit tests with code coverage turned on and the AllowPartiallyTrustedCallers assembly attribute set.

    Removing the AllowPartiallyTrustedCallers attribute caused my tests to run fine. I could also turn off code coverage to make them run but that was not an acceptable solution.

    Hopefully this helps someone else who makes it to this page trying to find a solution to this issue.

提交回复
热议问题