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 am using the 20090203 nightly build. I am currently reworking a product's business objects to use Lightspeed. I have an object with a one-to-one association and, using unit tests am persisting this fine. As part of the unit test I use a Find<> to try to get the data back to check it worked. Instead of the data, I get; System.NullReferenceException: Object reference not set to an instance of an object. ... Some help to point me in the right direction would be greatly appreciated! Thanks, Chris. |
|
|
A possibly related thread; http://www.mindscape.co.nz/forums/Thread.aspx?ThreadID=1560 |
|
|
Hello Chris, The only place I can see at that stack trace that might have caused a NullReferenceException would be if the type you are querying for doesn't have a public default constructor (perhaps because you have added a non-default constructor in the partial class?). However, if that's the case, the nightly build you are using should be throwing a LightSpeedException with a more meaningful message. Can you check that Visual Studio has picked up the updated build? The 20090203 nightly build was the first one to be versioned 2.2 (it slipped out a bit early, sorry!), so if you previously had references to v2.1 at its install location, you would need to update those to point at the v2.2 install location. If your class does have a public default constructor, or Visual Studio is definitely referencing the 3 Feb nightly, then could you provide us with the offending entity definition (in C#, VB or .lsmodel format) and the SQL CREATE TABLE scripts please? If you know the values stored in the database for the item(s) your query is retrieving then that would be useful to know as well. Thanks! |
|