I have a project that is using a blog service. In this service, there is an object that is of type System.Runtime.Serialization.IExtensibleDataObject
.
This is all fine and I can build my project locally and publish it (and both work when running under IIS) but when I check in, the build on the gated check in fails (see error below) and I cannot check in the code.
error CS0012: The type 'System.Runtime.Serialization.IExtensibleDataObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
This dll is referenced in my DAL project which is referenced by my website project.
My project uses .net 4.6.1 and I check this was installed on the build server. I also checked the location of the dll file is the same (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Runtime.Serialization.dll
- it's on the build server and where it should be.
I have tried adding the reference to the website project as well but this didn't help. I'm not sure what would be causing this and am at a loss as to how to solve it.
Any help would be appreciated if anyone has experienced anything similar
If it makes a difference, I am running locally on windows 10, but the build server is windows server 2012 (although my published site also works on windows server 2012)
Ok, in order to solve this, I had to add a reference to the System.Runtime.Serialization
in all the projects that referenced the DAL project and was used by the website project.
Just seems stupid that it would build locally and not on the build server