Visual Studio 2015 and Unity: Warning MSB3268 breaks build.

Hello there,

Using Unity 5.3.4f1 and VS2015 as an external tool for C# scripting, I came across these warnings when using classes like Text or Button:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3268: The primary reference “UnityEditor” could not be resolved because it has an indirect dependency on the framework assembly “System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089” which could not be resolved in the currently targeted framework. “.NETFramework,Version=v3.5,Profile=Unity Web v3.5”. To resolve this problem, either remove the reference “UnityEditor” or retarget your application to a framework version which contains “System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”.

(Same warning for “UnityEngine.Networking” and “UnityEngine.UI”).

These warnings leads to “error CS0246: The type or namespace name ‘xxx’ could not be found …”

I don’t know what to do, especially when I can’t open the project’s properties page so I can check my target framework.

Any thoughts on the matter ?

Hey,

Unfortunately that’s a known issue that can happen when the build target in Unity is the Web Player.

If you switch to Windows Standalone it should work all the time.

It works! Thank you jbevain !