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
|
Hi, I'm upgrading our application from LS 3.0 to LS 4.0 and encountering an exception when I create the first Unit of Work.
The table does have an Attached is a screen grab of the Properties Window in VS2010.
The LightspeedContext is using I have also opened the Lightspeed Designer, moved something, and re-saved to see if there was difference in the generated code (there was none). Generated code for Can you explain the error / suggest any solutions? |
|
|
What is the inner exception? |
|
|
Sorry, I thought the inner exception was in the original post. Below are the both exception messages and call stacks. Exception 1: Unable to materialize field [Id] on type [NinjaTheory.NinjaPerformanceMonitor.Lightspeed.Sentinel.SentinelStat]. Check your table has an Id column and that your mappings are correct. See inner exception for details.
Exception 2: Operation could destabilize the runtime.
|
|
|
There are a couple of possibilities here. The first is that this is an ASP.NET medium trust issue, but if the same code worked under LightSpeed 3.x, that seems unlikely. (I also think you would get a different exception in this case.) However, if you have changed anything other than the LightSpeed version that could have resulted in going into medium trust, then this could be the issue. The second is that this is an internal error possibly related to the data type or value being returned from the database (though this would normally result in an InvalidCastException). Unfortunately we have not been able to reproduce the error here, so we haven't been able to investigate this. Does it happen on all SentinelStat records or only specific ones? How is the StatID column declared in the database? What database provider are you using? Is it possible for you to create a minimal repro (console or NUnit test project, and minimal database) so that we can try to progress this for you? |
|
|
I doubt that is the first possibility as it is a desktop application running under full-trust and nothing else has changed other than the LightSpeed version (if I change to point to the LS 3.0 assemblies, it works again). More information below:
If the above does not help narrow this issue down I could create a minimal repro. |
|
|
Sorry, nothing jumps out from that as a possible cause (though I agree we can rule out the medium trust theory). I think we're going to need the repro. Thanks! |
|
|
OK. I will try to create a minimal repro of this issue tomorrow. Are you able to create a test MSSQL database/table on your end? I will provide the CREATE scripts. |
|
|
Yes, SQL Server is fine. Thanks! |
|
|
I have resolved the error that I was having by doing a complete uninstall of LS 3.0 and then installing the latest LS 4.0 nightly build (21 November). It is possible that I was using the LS 3.0 custom tool with LS 4.0 assembly. |
|