You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warn when referencing packages that target a version of .NET Core that isn't installed #501
The NuGet UI encourages users to upgrade NuGet packages to the newest version. This causes problems when it results users upgrading packages that result in the app no longer running. E.g. We've seen this causing problem with 2017 RC where 1.1 is not installed by VS, so when people upgrade their NuGet packages the app fails to launch.
Per conversation today, we'll fix this for .csproj tooling only
@Andrew-MSFT We're talking about Microsoft.NETCore.App here, right? Is it really just updating the nuget package that causes the app to fail to launch? It is supposed to work to take latest of that package so long as you do not change your TargetFramework. @dsplaisted is even in the process of baking that requirement in to the SDK.
Retargeting to something you cannot run is a different issue than being broken by a package upgrade.
Or is this just upgrading an arbitrary package that now needs netcoreapp1.1 and not netcoreapp1.0? But that should be prevented in the UI-guided upgrade process (nuget bug if it does not), and fail restore (ditto), and #26 already covers diagnostics for failed resolution, right?
It's because the shared framework is a "special" package and updating the package will fail if the shared framework isn't installed no matter what the TFM is.
OK, just tested and indeed I get this when running even if I don't change my TFM:
The specified framework 'Microsoft.NETCore.App', version '1.1.0' was not found.
- Check application dependencies and target a framework version installed at:
C:\Program Files\dotnet\shared\Microsoft.NETCore.App
- The following versions are installed:
1.0.1
- Alternatively, install the framework version '1.1.0'.
This contradicts what was discussed here: #450 (comment)
I think this means the approach in #450 is not sound.
@nguerrera right, the issue that we saw with 2017 RC is people go into the NuGet UI, it says that packages updates are available and when you update it fails.
We need feature work from NuGet to eventually avoid this problem, but that won't happen in time for 2017 RTM
@nguerrera it should be trivial to show a diagnostic (error) when the shared framework isn't installed. I thought we inferred the major and minor from the TFM for Microsoft.NETCore.App.
@davidfowl The inference isn't merged yet. Looks like it's trending that way on the PR, but we're bouncing back and forth on the design.
Here's what I see:
The reason nuget update and restore are happy is that package Microsoft.NETCore.App,v1.1.0 claims to be compatible with TFM netcoreapp1.0. Is the package busted?
If the package is correct, then when I reference it from TFM netcoreapp1.0, it should just work and not cause the error shown above on run. If it is correct and this is not what happens, then we're interpreting it wrong in the build.
If I do change my TFM to something that I can't run, then I should indeed receive a diagnostic that is easy to decipher, but we should be careful to distinguish between build-time and run-time diagnostics here. We should not introduce build errors if the build works as well as on any other machine, but we just do not have what it takes to run the output. This is not different from building a binary for ARM on an x64 machine. There's no error in building it, the error occurs when I try to run it on the same machine. The message shown above is actually a decent run-time error, but it is obscured on F5 because it only flashes on the screen for an instant. I think it is sufficient for the console, but we need a better experience in the IDE -- perhaps like how my debug options change to eliminate local machine when I switch from x86 to ARM for a UWP app.
I don't mean to stretch the analogy to ARM vs x86 too far. I mean that we should design an IDE experience of some kind that happens when I try to run: e.g. one that informs me that I don't have enough installed and guides me through installing it.
The reason nuget update and restore are happy is that package Microsoft.NETCore.App,v1.1.0 claims to be compatible with TFM netcoreapp1.0. Is the package busted?
No, the package is working fine. There are extra semantics that cause it to fail. That is the package is considered a "platform" package and that name is burned into runtimeconfig.json which causes it to fail at runtime. A simplifying analogy would be that Microsoft.NETCore.App has the refs and the runtime implementations are installed with the shared framework. That's why you can't run.
but we should be careful to distinguish between build-time and run-time diagnostics here.
As much as I agree with that in the purest forms, I'd prefer an error diagnostic in this case because it's the 90% case, it's IDE agnostic (will work in VS for MAC and VS code) and it's easiest to implement.
The other thing is these types of error for web projects aren't visible when running in IIS. Try the same thing in a web project and look at the experience.
No, the package is working fine. There are extra semantics that cause it to fail. That is the package is considered a "platform" package and that name is burned into runtimeconfig.json which causes it to fail at runtime.
I see, but then I'm missing the point of the 1.1 package supporting 1.0. If it just didn't claim to support 1.0, then nobody would be able to upgrade it without updating TFM, which seems to be desirable based on my evolving understanding here.
I see, but then I'm missing the point of the 1.1 package supporting 1.0. If it just didn't claim to support 1.0, then nobody would be able to upgrade it without updating TFM, which seems to be desirable based on my evolving understanding here.
Agreed, we should have made it not possible to restore but it's too late now.
I see, but then I'm missing the point of the 1.1 package supporting 1.0. If it just didn't claim to support 1.0, then nobody would be able to upgrade it without updating TFM, which seems to be desirable based on my evolving understanding here.
Agreed, we should have made it not possible to restore but it's too late now.
@dsplaisted it's not though, we need to see the error when things aren't installed. What we did was make it so that it's harder to get out of sync (using the TFM), the problem still exists that you may not have the runtime installed at all. That needs to be handled.
@davidfowl We've got #458 for providing an error / diagnostic when the right shared framework isn't installed. Can we use that one and close this issue?
Activity
nguerrera commentedon Dec 15, 2016
cc @jinujoseph
davidfowl commentedon Dec 15, 2016
IMO this should be part of the diagnostic work here #26
nguerrera commentedon Dec 15, 2016
@Andrew-MSFT We're talking about Microsoft.NETCore.App here, right? Is it really just updating the nuget package that causes the app to fail to launch? It is supposed to work to take latest of that package so long as you do not change your TargetFramework. @dsplaisted is even in the process of baking that requirement in to the SDK.
Retargeting to something you cannot run is a different issue than being broken by a package upgrade.
nguerrera commentedon Dec 15, 2016
Or is this just upgrading an arbitrary package that now needs netcoreapp1.1 and not netcoreapp1.0? But that should be prevented in the UI-guided upgrade process (nuget bug if it does not), and fail restore (ditto), and #26 already covers diagnostics for failed resolution, right?
davidfowl commentedon Dec 15, 2016
It's because the shared framework is a "special" package and updating the package will fail if the shared framework isn't installed no matter what the TFM is.
nguerrera commentedon Dec 15, 2016
OK, just tested and indeed I get this when running even if I don't change my TFM:
This contradicts what was discussed here: #450 (comment)
I think this means the approach in #450 is not sound.
AndrewBrianHall commentedon Dec 15, 2016
@nguerrera right, the issue that we saw with 2017 RC is people go into the NuGet UI, it says that packages updates are available and when you update it fails.
We need feature work from NuGet to eventually avoid this problem, but that won't happen in time for 2017 RTM
davidfowl commentedon Dec 17, 2016
@nguerrera it should be trivial to show a diagnostic (error) when the shared framework isn't installed. I thought we inferred the major and minor from the TFM for Microsoft.NETCore.App.
nguerrera commentedon Dec 17, 2016
@davidfowl The inference isn't merged yet. Looks like it's trending that way on the PR, but we're bouncing back and forth on the design.
Here's what I see:
The reason nuget update and restore are happy is that package Microsoft.NETCore.App,v1.1.0 claims to be compatible with TFM netcoreapp1.0. Is the package busted?
If the package is correct, then when I reference it from TFM netcoreapp1.0, it should just work and not cause the error shown above on run. If it is correct and this is not what happens, then we're interpreting it wrong in the build.
If I do change my TFM to something that I can't run, then I should indeed receive a diagnostic that is easy to decipher, but we should be careful to distinguish between build-time and run-time diagnostics here. We should not introduce build errors if the build works as well as on any other machine, but we just do not have what it takes to run the output. This is not different from building a binary for ARM on an x64 machine. There's no error in building it, the error occurs when I try to run it on the same machine. The message shown above is actually a decent run-time error, but it is obscured on F5 because it only flashes on the screen for an instant. I think it is sufficient for the console, but we need a better experience in the IDE -- perhaps like how my debug options change to eliminate local machine when I switch from x86 to ARM for a UWP app.
nguerrera commentedon Dec 17, 2016
I don't mean to stretch the analogy to ARM vs x86 too far. I mean that we should design an IDE experience of some kind that happens when I try to run: e.g. one that informs me that I don't have enough installed and guides me through installing it.
davidfowl commentedon Dec 17, 2016
No, the package is working fine. There are extra semantics that cause it to fail. That is the package is considered a "platform" package and that name is burned into
runtimeconfig.jsonwhich causes it to fail at runtime. A simplifying analogy would be thatMicrosoft.NETCore.Apphas the refs and the runtime implementations are installed with the shared framework. That's why you can't run.As much as I agree with that in the purest forms, I'd prefer an error diagnostic in this case because it's the 90% case, it's IDE agnostic (will work in VS for MAC and VS code) and it's easiest to implement.
The other thing is these types of error for web projects aren't visible when running in IIS. Try the same thing in a web project and look at the experience.
nguerrera commentedon Dec 17, 2016
I see, but then I'm missing the point of the 1.1 package supporting 1.0. If it just didn't claim to support 1.0, then nobody would be able to upgrade it without updating TFM, which seems to be desirable based on my evolving understanding here.
davidfowl commentedon Dec 18, 2016
Agreed, we should have made it not possible to restore but it's too late now.
davidfowl commentedon Dec 18, 2016
That would have lead users to change the TFM and then it would still fail the same say on f5 though...
dsplaisted commentedon Dec 29, 2016
@davidfowl This seems to contradict with your comment here: #450 (comment)
Could we use the target framework version instead of the platform package version when we write the framework version to the runtimeconfig.json file?
dsplaisted commentedon Jan 5, 2017
This should be addressed with #450
davidfowl commentedon Jan 5, 2017
@dsplaisted it's not though, we need to see the error when things aren't installed. What we did was make it so that it's harder to get out of sync (using the TFM), the problem still exists that you may not have the runtime installed at all. That needs to be handled.
dsplaisted commentedon Jan 5, 2017
@davidfowl We've got #458 for providing an error / diagnostic when the right shared framework isn't installed. Can we use that one and close this issue?
davidfowl commentedon Jan 5, 2017
Sure
Update dependencies from https://github.com/dotnet/arcade build 20190…