Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Studio/Visual Studio Broken - The target "Build" does not exist in the project. (MSB4057)

I'm starting out with Xamarin Studio after working with Visual Studio (2012 last) for a good few years. However someone through importing projects, and starting new Android projects I've managed to break Xamarin Studio. Now when starting a new project I get the following error;

The target "Build" does not exist in the project. (MSB4057)

The steps;

Starting a new project

Build result

I've tried to repair my installation, but this made no difference. I've tried doing a reinstall but this made no difference. Other than a complete uninstall and reinstall what options do I have?

I'm using Xamarin Studio 4.2.2, and can confirm I now have the same problem in Visual Studio 2012. Although I can manually build projects using MSBuild.exe, but other than that both IDEs are broken.

like image 713
wonea Avatar asked Jan 14 '14 16:01

wonea


2 Answers

I've actually managed to track down the problem to a problem with .Net framework setup, somehow by playing around with the build settings within the Xamarin IDE I've corrupted it. To diagnose this problem in Visual Studio 2012 I turned on MSBuild build settings to Diagnostic;

Visual Studio Option

Then identified a problem with C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets, and using a DIFF tool isolating the settings against a machine which had a working build process - copying the missing entry.

Missing Build Setting

This seems to be a bug within Xamarin Studio, when time allows, I'll have to reproduce this for a bug report.

like image 51
wonea Avatar answered Nov 20 '22 21:11

wonea


Xamarin Studio doesn't open any MSBuild target files (even in readonly mode) as part of normal usage. The only thing which opens these files is the build engine provided by Microsoft which both XS and VS use.

What may have happened is that VS/XS opened the targets file when a build error was double clicked in the Error Pad and then you accidentally modified and saved the file inside the IDE. That does seem very unlikely though, but it's the only thing I can think of.

The other alternative is a deliberate edit of those files, which is probably even less likely ;)

like image 42
Alan McGovern Avatar answered Nov 20 '22 20:11

Alan McGovern