Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project. #85

Closed
AArnott opened this issue Jun 22, 2018 · 10 comments · Fixed by #84
Closed

Comments

@AArnott
Copy link
Collaborator

AArnott commented Jun 22, 2018

After updating to the latest MSBuild.Sdk.Extras, dotnet restore fails with:

error MSB4057: The target "_GetRestoreSettingsPerFramework" does not exist in the project.

msbuild /restore still works, however.

AArnott added a commit to microsoft/vs-validation that referenced this issue Jun 22, 2018
@clairernovotny
Copy link
Collaborator

dotnet-based commands won't work with the extras...they'll always need msbuild. Is that a blocker?

AArnott added a commit to microsoft/vs-validation that referenced this issue Jun 22, 2018
@AArnott
Copy link
Collaborator Author

AArnott commented Jun 22, 2018

I don't think it's a blocker, since most of the time I'm using the extras it's with WPF or PCLs which won't build (nicely) off Windows anyway.

It used to work though. Was it an intentional loss when it stopped working? Any chance it could start working again? Building with .NET Core on a docker image is a way to ensure the build always works on every (CI) machine, so I've slowly been moving in that direction.

@clairernovotny
Copy link
Collaborator

I don't think it's an intentional change, but it's not a configuration that's tested. The main reason is that all of the tasks brought in by the targets pointed to are based on .NET Framework and don't have .NET Core variants (today). Even net is bringing the full .NET Framework targets, which is how we can support WPF/WCF, etc.

@clairernovotny
Copy link
Collaborator

I'd certainly take a PR that fixes it for restore if there's an easy solution.

@AArnott
Copy link
Collaborator Author

AArnott commented Jun 22, 2018

Apparently it's not just restore. If I restore in another way, then use dotnet build --no-restore it fails with:

error MSB4057: The target "Build" does not exist in the project.

I don't think I'll take time to look for a way to fix this right now. Maybe sometime if I have time and can't easily enough drop use of dotnet.exe.

@clairernovotny
Copy link
Collaborator

What does work is dotnet test foo.csproj --no-build --no-restore on a project that's already built with msbuild that's how I run my unit tests in VSTS.

@AArnott
Copy link
Collaborator Author

AArnott commented Jun 22, 2018

Ah, that's good. :)

@clairernovotny
Copy link
Collaborator

Here's how I do it for Rx.NET, with code coverage now from the latest SDK's:
https://github.com/dotnet/reactive/blob/master/.vsts.rx-shared.yml

I need one workaround since embedded pdb's aren't yet supported by code coverage, so I have to build again for it :/

@chucklu
Copy link

chucklu commented Jun 19, 2019

Encounter the same error information when build Newtonsoft.Json project, the solution is to install portable library
JamesNK/Newtonsoft.Json#2057 (comment)

@moljac
Copy link

moljac commented Feb 23, 2022

also Guava Xamarin.Android builds on windows from XamarinComponents repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants