This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am attempting to upgrade an asp.net mvc project to .NET 4.0 and the latest nightly build of LightSpeed(Aug 19th), however when I attempt to load a page that accesses the database through LightSpeed, I get the error message "Operation could destabilize the runtime." This error happens on a very basic linq query and is behind a repository class, but there is nothing out of the ordinary about the setup. I should add that the app is running in medium trust. Looking at the framework version numbers on on the Mindscape.LightSpeed.dll, it appears to be compiled for version 2.0 of the clr.. I have searched the forums and find no mention of .NET 4.0 and the docs only mention 3.5 SP1. Here is the actual line of code that throws the exception Account = UnitOfWorkScope.Current.Accounts.SingleOrDefault(a => a.Subdomain == "abc123");
Does lightspeed run on .NET 4.0? Any guidance on what might be causing this issue otherwise? |
|
|
That's correct, LightSpeed is built against the 2.x CLR, but we've had it running on the .NET 4 CLR with no problems. So I'm not sure what would be causing the error there. Is there a stack trace? One thing you could try is setting the useLegacyV2RuntimeActivationPolicy option in your web.config. I believe this can help with compatibility issues. |
|
|
|
|
|
I believe that this is related to Medium trust... I just changed the app over to full trust to see what happens and it runs fine... Medium trust strikes again :) |
|
|
Aha, thanks for the extra info. We'll see if we can get that fixed -- I'm assuming though that this isn't a showstopper for you right now. |
|
|
It's not a showstopper right now, but we were planning on upgrading to .NET 4.0 pretty soon... I REALLY, REALLY don't want to run the app in full trust for security reasons. Any rough idea on timeframe when you might support .NET 4.0 in medium trust, like days, weeks, months? Thanks for the response :) |
|
|
We're pretty heavily loaded at the moment, so I can't promise a really quick fix. I'll aim to look at this within a week, but I can't make a promise on that. It could be as much as three weeks (we have a conference the week after next, so anything that doesn't get done by the end of next week will be held up for several extra days). How quickly were you hoping to upgrade to .NET 4? |
|
|
That's totally fine... no super big hurry and I don't have any hard deadline to meet. I can just lock down a few other things and run it in full trust in the interim. mike |
|
|
Hi Mike, We have had a look into this and it appears to be an issue in the framework - we have raised a connect ticket about this and we will keep you posted on what comes back from that :)
Jeremy |
|
|
The issue is at https://connect.microsoft.com/VisualStudio/feedback/details/587594 if you want to vote it up! |
|
|
Cool my first .NET Framework bug... Any plans to release a version of Lightspeed compiled for .NET 4.0? Is there even a benefit to that I wonder? |
|
|
Hi, I'm sorry I drawing this topis out again, but I'm on hosting v4.0 and I get the same error: Operation could destabilize the runtime. Since I'm on webhosting, I can't use <startup useLegacyV2RuntimeActivationPolicy="true"> becuse it has to be placed here: C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer40.exe.config as stated here (http://blogs.blackmarble.co.uk/blogs/rfennell/archive/2010/03/27/mixed-mode-assembly-is-built-against-version-v2-0-50727-error-using-net-4-development-web-server.aspx) What else can I do?
Thanks, Pooik |
|
|
If this is a mixed-mode activation issue, I believe you should still be able to put the useLegacyV2RuntimeActivationPolicy attribute into web.config for your production vroot. The configuration file Richard refers to is for the Visual Studio development Web server, NOT the IIS production server. And since that is your private dev server you can meddle with its config file all you like! Note however that this may be a medium trust issue in the .NET Framework rather than a mixed-mode activation issue -- see Jeremy's post and the Connect ticket for details. If so you may need to target .NET 3.5 instead of .NET 4, or partition your solution into 3.5 and 4.0 assemblies. |
|