Unexpected error has occurred during the library compilation process; System.Private.Xml.Linq

Hello all,

I am having trouble to debug/publish a project; which worked as expected in other computer but not where i am implementing the process. The error it throws is this one:

The assembly compilation returned the following errors:

  • The type ‘XDocument’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Private.Xml.Linq, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’.
  • The type ‘XDocument’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Private.Xml.Linq, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’.
  • The type ‘XDocument’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Private.Xml.Linq, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’.

I have no idea what it does mean, but i understand it could be an issue with the ‘System.Private.Xml.Linq’ assembly not being defined. I already searched online and haven’t found a similar case. When i analyze the full project, it doesnt throw any errors. I even managed to run it from the computer i build it.

@cramos13

  1. Try to open imports and import that namespace there
  2. Try to copy the .nuget folder from the machineit is running to the troublesome machine

C:\users\<username>\.nuget

Cheers