MSBuild error "CSC : error CS2001: Source File 'x' could not be found" with Linked Files after upgrading to Visual Studio 2012

Try getting the Build Logs,

http://msdn.microsoft.com/en-us/library/vstudio/ms171470.aspx

it seems that csc task could not find the source file. One cause it you import the wrong file. so you have to edit the project file via normal Text Editor.


I found a solution to this issue, when you linked the file, you relative path is recognized by msbuild and go back from there it become your path in a long path however you can change it in the project definition doing right click/unload the project/ and change the path from ../../../ to $(SolutionDir)/../.. until find the file to link, note: it's extend the character from 255 to 300 character.