0

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)

Pete
  • 57,112
  • 28
  • 117
  • 166
  • Have you run a build in verbose mode and checked the output for clues? – stuartd Aug 16 '16 at 11:49
  • As it's a tfs build, not sure how to set the verbosity on it, from the posts I have seen, there should be a diagnose setting under the process tab, but my process tab looks different to the ones shown – Pete Aug 16 '16 at 12:10
  • This may help - "To change the verbosity for a TFS 2013 build from the build definition, pass the parameter: `/flp:verbosity=""` in the MSBuild arguments section, of the Process tab, in the build definition." - [source](https://blogs.msdn.microsoft.com/tfssetup/2014/10/23/set-ms-build-output-verbosity-from-build-definition-for-tfs-2013/) – stuartd Aug 16 '16 at 12:29

2 Answers2

0

Try the solution in this post:

Add the System.Runtime.Serialization in the main file.

Community
  • 1
  • 1
Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • Not sure what you mean by the "main file". Also, if you are just copying an answer from another question, you should vote to close the question as a duplicate, not just paste the same answer – Pete Aug 17 '16 at 14:37
0

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

Pete
  • 57,112
  • 28
  • 117
  • 166