简体   繁体   中英

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;

开始一个新项目

建立结果

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.

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选项

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.

缺少构建设置

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

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 ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM