This occurred when I was trying to move my Models out of my main MVC web application assembly. The main web dll is called Web and within that project is a folder called Models that is used to store all my *ahem* Models and entity data models etc. I decided to move everything in the Models folder out into its own Models assembly. I edited all the namespaces and everything built okay.
However, I was getting a runtime MetadataException when trying to view the page. What the hell is going on?!
SolutionThe problem is that the connection string was incorrect. It wasn't immediately obviously with that error message but when you think about it, it makes sense.
My connection string was:
Just so you know the metadata represents this
Since I have moved the models around and the namespace is now different I needed to make it
Just for further understanding I could have replaced the asterix with Models since that is the name of the dll that contains my Messaging models.