I have created a Entity Framework mapping based on the book "Microsoft Entity Framework in Action". The OrderIT DB is available for download from the link. I am on VS 2010 RC and this is my first serious try of EF. But I keep getting an error
"Object reference not set to an instance of an object. Model.edmx"
I have broken the .edmx file into constituent ssdl, csdl and msl files and ran edmgen and it
gives me the same error as shown below. EdmGen /mode:ValidateArtifac开发者_开发百科ts /incsdl:OrderIT.csdl /inssdl:OrderIT.ssdl /inmsl:OrderIT.msl
error 7001: Object reference not set to an instance of an object.
Validation Complete -- 1 errors, 0 warnings
Obviously something is wrong with the mapping but the error message gives me no details. Why I am getting this error and how to fix it ?
I have uploaded the relevant files here.
Update I did the whole thing again and this time marked the Company class as abstract. Looked like it is working now. It maybe this is the issue but I am not certain as I am new to EF in general.
Looks like you found a bug in the RC. You should report it here, as soon as possible.
That said, I'm not sure you actually need to do what you're trying to do. Can you explain what your goal is? For a simple case of using the EF, you should not have to run EdmGen manually.
I made the Company class abstract and it build correctly. With my inexperience in EF and the error message not indicating any details I was stumped.
精彩评论