Site runs fine locally, but throws this from Windows Azure Websites hosting environment.
CS0012: The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
So this is an infamous message and has a known fix;
<compilation ... >
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
</compilation>
I understand that the ASP.NET pages/views are compiled at a different time to the controllers and other logic, (that vNext is finally going to address this), and that the above is adding a reference for the page compilation side of things.
But my question is: why does this work on my development machine but needs this extra config on the WAWS environment, which you'd think was perfectly setup?
I would like to know what's different, what's missing on the target environment such that referencing a portable library (portable, meaning it should 'just work' in a variety of environments) actually breaks stuff.
Moreover, why is it that when I reference a PCL, System.Object
suddenly isn't found in Mscorlib. Once upon a time I used to understand all this, and then it all got confusing.
using
to the top of the .cs class for the particular assembly / reference.. – MethodManSystem.Runtime
in is the GAC, which I guess is why its not a problem locally. But what put it there? – Luke Puplett