Operation could destabilize the runtime?

前端 未结 11 1568
执念已碎
执念已碎 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:08

    I ran into this error while using the "Dynamic data access framework" Passive library. The source of the error was line 100 in the DynamicDatabase.cs file.

    databaseDetectors = (databaseDetectors ?? Enumerable.Empty()).DefaultIfEmpty(new DatabaseDetector());
    

    I changed that line of code to:

    databaseDetectors = (databaseDetectors ?? Enumerable.Empty()).DefaultIfEmpty(new DatabaseDetector()).OfType();
    

    Doing so resolved the problem. I went ahead and forked the project and submitted the change to the original author.

    Thank you, Jason Baker, for pointing out the solution in your original question.

    On a side note, the original library ran fine on my local machine and on a Rackspace VPS, but when I pushed the same code to a shared hosting environment (GoDaddy and Rackspace's Cloud Sites), I began getting the "Operation could destabilize the runtime" error.

提交回复
热议问题