0

I've searched the depths of the internet and I cannot find an answer or workaround for this problem. I have no idea either what is causing it.

I keep getting the error in Xamarin Studio:

Error: Error building target GetReferenceAssemblyPaths: UNC paths should be of the form     \\server\share.

Can someone explain this to me?

Here's a link to one of the project files: http://pastebin.com/qZ5uGL9S

6
  • 1
    Did you open the project from a network share?
    – Gene
    Nov 12, 2013 at 15:34
  • Nope, its on my computer locally.
    – Anthony
    Nov 12, 2013 at 15:36
  • 1
    seems like there are some references somewhere pointing to the UNC....maybe it was copied locally from a share? Nov 12, 2013 at 15:40
  • you should share the .csproj or .sln file that is showing the problem (i.e. in gist.github.com?), so we can have a look at it
    – knocte
    Nov 12, 2013 at 15:44
  • Would the references be in the .csproj file? I'm looking for references inside the file and cannot find them.
    – Anthony
    Nov 12, 2013 at 15:46

4 Answers 4

0

If you inspect your project file you have a couple of extra backslashes in some of your FXCopy rule paths i.e.

<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools**\\**Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop**\\**Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools**\\**Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop**\\**Rules</CodeAnalysisRuleDirectories>

The compiler is probably picking these up as UNC paths, replace them with a single backslash and it should compile ok.

2
  • I ended up removing these (created a new solution, here is the new csproj file: pastebin.com/k92KNZ54. Still getting the same error :(
    – Anthony
    Nov 12, 2013 at 16:53
  • I am also having issues, and my .vbproj is similar to his, and has no traces of FXCopy. Still getting the build error.
    – FilBot3
    May 13, 2014 at 14:41
0

I UnChecked the use MSBuild and this fixed it.

1
  • 1
    Yeah, it seems the MSBuild engine doesn't like the TargetFrameworkVersion v4.0. I saw this too, and changing to v4.5 or v3.5 (Options -> Build -> General -> Target framework) also worked. Feb 13, 2014 at 21:25
0

When I created my project in Microsoft Visual Studio 2012, I selected TargetFrameworkVersion 3.5. Visual Studio 2012 creates project files with ToolsVersion="4.0". Apparently the Mono installation (mine was 3.2.3) doesn't digest the 4.0 toolset very well. So I opened my csproj file in Notepad and changed it to ToolsVersion="3.5". It fixed the problem.

NB: TargetFrameworkVersion and ToolsVersion are two different things. ToolsVersion specifies the version of MSBuild tools to use when building your project whereas TargetFrameworkVersion is the version of .NET Framework to target.

0

Slightly unrelated, but I received a similar error immediately when building a coworker's old Visual Studio project:

Error: Failed to write to log file "\\projName.log". The UNC path should be of the form \\server\share.

I fixed it by changing the Project Configuration Properties Build Log File field. It had incorrect variables that were evaluating to blank:

$(IntDir)\$(MSBuildProjectName).log

Fixing this allowed the build to run flawlessly. Maybe this will help someone, or I can open a new question and answer it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.