-
Notifications
You must be signed in to change notification settings - Fork 258
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
Restoring with invalid target framework says 'unsupported' instead of showing bad framework name #5413
Comments
Good catch, it looks like we throw this error later after parsing the framework and lose the original. This should be fixed. |
Similar issue, not sure if the same: Restore a project with Microsoft.NET.Sdk that doesn't specify
It should probably fail earlier with a better error message, when it can't retrieve the TargetFramework from a project. Right now it fails too late, with this stack:
Instead it should validate inputs earlier, somewhere here. See how TargetFramework is an empty string: Maybe even avoid calling RestoreTask in that case. |
Aha, I see the GetProjectTargetFrameworksTask should probably be the one reporting an error: |
consider as part of net5.0tfm work |
@rrelyea What is the status of this? I ask because I am running into an issue where when I build a solution file in VS the output of the dg file is different then say I use I currently have a custom TFM, and based on the debugging I have done I can't see how the framework parsing for nuget would even know about my custom Tfm, but then again the dg file does generate something in VS. within VS:
but with msbuild or dotnet I get:
it looks like when running from within VS it uses the Actually seems like VS is using the |
With 6.0,
In VS you'd get:
But you still get the SDK error. As such, I think this can be considered fixed. |
Given
<TargetFramework>abc123</TargetFramework>
, RestoreTask yields:It should indicate the badly spelled framework 'abc13' in the error message instead of 'unsupported'.
We tried to fix this by running our own check before restore in the SDK, but that breaks adding support for additional TFMs like uap using the MSBuild.Sdk.Extras package.
The text was updated successfully, but these errors were encountered: