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
Latest SDK does not honor Microsoft.NetCore.App and NetStandard.Library versions from csproj #596
With the latest SDK, the version of Microsoft.NetCore.App in your project file is not longer being honored.
The M.NC.App is being inferred by the SDK and the user choice is being completely ignored.
I know we can set DisableImplicitFrameworkReferences, but I am not sure that telling our customers to learn these nobs is the right thing to do.
Whatever the user sets should win.
Besides, this will create other problems:
It is not really intuitive to users why their package choices are not being honored.
It breaks the LTS/FTS story. The SDK will always pick the version (1.0.1) right now. What is the point of shipping 1.0.3 or 1.1.0 in the CLI.
We need to update the SDK to use a new version of M.NC.App.
This will lead to weird update problems. For instance, in order for the SDK to move to say, 1.0.3, it will either have to install 1.0.3 itself or the CLI will have to carry it, along with say, 1.0.1, which is what the SDK currently likes. Only once the SDK moves to 1.0.3 the CLI could move to 1.0.3.
Reacted by gulbanana, Nate McMaster and Richard Simpson
@srivatsn@nguerrera@dsplaisted can you please look at this right away? This seems like a big UX impact for the upcoming release.
@eerhardt@BlackDwarf@mlorbetske FYI as this will likely impact work you're doing right now. What we saw was that all CLI projects were reverted to NetCoreApp 1.0.1 despite specifying 1.0.3 in our project files.
Are you are writing <PackageReference Update="Microsoft.NetCore.App" Version="1.0.3" /> in your csproj? The item is added by the props with an include and to update the metadata, you have to use the Update syntax.
I suspect you are using the Include syntax? If so, @dsplaisted mentioned that two items will be created and NuGet might be picking the higher version or, more likely, the first one. If you folks are running into this, then this is likely going to be a very common mistake.
All of the bullets mentioned above are goals though and are possible as long as you use the Update syntax and I believe VS tooling will use the Update syntax correctly when upgrading the package. @dsplaisted@rainersigwald@AndyGerlicher@cdmihai - any suggestions on how to prefer the item in the project file if it was created using the Include syntax?
For NETStandard.Library, you can use the Package Manager UI to update the version of the package and it will write this to your project file. The reference to Microsoft.NETCore.App is marked as ReadOnly to prevent updates from showing up, because things can break if the version of Microsoft.NETCore.App that you reference doesn't match the target framework version of your project. If we change the package so that you can use the latest version of the package with earlier TFMs, then we will probably remove the ReadOnly setting for that reference.
You can also modify the version of the shared framework that is written to runtimeconfig.json by specifying the RuntimeFrameworkVersion property:
If this property is defined, then it's value will be used as the version of the shared framework written to runtimeconfig.json. Setting the property won't change which version of the Microsoft.NETCore.App package is referenced and hence compiled against, but I believe there shouldn't be any API changes between the patch versions so that shouldn't matter.
If we knew NuGet's preference perhaps the code could be changed to ensure that NuGet prefers the user's choice? Ideally, the default would be set in our .props, then the user's choice would override our default, and then NuGet would prefer the user's choice. @rrelyea@rohit21agrawal is that feasible? Alternatively, could we add the implicit reference in the .targets file so it gets added after the user's choice?
If we added in the targets, then you can't use the Update syntax to update. Two items is not a good place to be because then every consumer needs to know which one to pick.
Two items is the state we were in, right? I think that avoiding the update syntax should be an explicit goal. Folks shouldn't have to think about which one to use for a give Package Reference. Neither is always right and there is no project file artifact that tells us which to use in a given context. The rule seems to be "go figure out if an SDK is adding this reference" which is pretty bad...
Reacted by Mike Lorbetske, Nate McMaster and Bryan Chong
Currently going through the templates updating them to make use of the implicit references. The packageref for libraries going away is nice, but every app has an update to 1.0.3 which defeats the purpose imho. Moreover, users would no longer have a recognizable place to update should they want to move to a newer version (or pin to a specific one & survive behavior changes with default version updates) if we go ahead with making this entirely implicit.
Folks shouldn't have to think about which one to use for a give Package Reference.
The idea behind the implicit references is that folks should generally not need to think about Package References to NETStandard.Library or Microsoft.NETCore.App at all. As much as possible, they should be an implementation detail that's not surfaced to users.
but every app has an update to 1.0.3
We should instead just update the SDK to implicitly reference 1.0.3 if you're targeting netcoreapp1.0. We have #572 filed for this.
Sorry, must have missed #572 in my notifications previously, thanks for moving it up to 1.0.3 by default - when do we expect that to be ready?
I agree with the sentiment that users shouldn't have to worry about it, but I do still worry about the discovery issues for non-VS development environments and (with the current lack of version assertions in projects for particular SDKs) the possibility of having different implicit package references in different contexts.
Since we float to the latest patch automagically, you don't actually need to update to 1.0.3 to target it. Once you install it, it will be used. That even happens today if you target 1.0.1 but install 1.0.3.
Yep, I agree that this should not often be surfaced to users. When it's needed, we would best serve our customers if they didn't need to deal with an unexpected pattern. I'm really worried about users that need to specify the framework version. This Update syntax is only going to be used for PackageReferences in this scenario, AFAIK. People will be very familiar with PackageReferences and will quite naturally use Include instead.
If we feel that we cannot make Include work, can we at least fail with a good error message when Include is used? Something that enables easy searches and, ideally, tells folks what to do?
Portable applications. Shared frameworks need to use packages to get the implementation until we fix how that works (getting implementations from the shared framework always). We need to think about standalone more here.
Part of the issue is that we'll need to touch all of our project files to move from RC.2 to RC.3. If that were the only issue, this would a manageable, though cumbersome, requirement.
The bigger concern we want addressed is that cross-targeting requires this ugliness in the project #596 (comment) or opting out via the DisableImplicitFrameworkReferences property. Both require a high-level knowledge of SDK internals, far beyond what I would expect from the average user.
Plus, I'd echo the concerns @livarcocc mentioned in the original issue about LTS/FTS and complications down the road caused by hardcoding versions into the SDK now.
Activity
TheRealPiotrP commentedon Jan 6, 2017
@srivatsn @nguerrera @dsplaisted can you please look at this right away? This seems like a big UX impact for the upcoming release.
@eerhardt @BlackDwarf @mlorbetske FYI as this will likely impact work you're doing right now. What we saw was that all CLI projects were reverted to NetCoreApp 1.0.1 despite specifying 1.0.3 in our project files.
srivatsn commentedon Jan 6, 2017
Are you are writing
<PackageReference Update="Microsoft.NetCore.App" Version="1.0.3" />in your csproj? The item is added by the props with an include and to update the metadata, you have to use the Update syntax.I suspect you are using the Include syntax? If so, @dsplaisted mentioned that two items will be created and NuGet might be picking the higher version or, more likely, the first one. If you folks are running into this, then this is likely going to be a very common mistake.
All of the bullets mentioned above are goals though and are possible as long as you use the Update syntax and I believe VS tooling will use the Update syntax correctly when upgrading the package. @dsplaisted @rainersigwald @AndyGerlicher @cdmihai - any suggestions on how to prefer the item in the project file if it was created using the Include syntax?
dsplaisted commentedon Jan 6, 2017
See #450 for context on this.
You can override the version of the package with the following:
For NETStandard.Library, you can use the Package Manager UI to update the version of the package and it will write this to your project file. The reference to Microsoft.NETCore.App is marked as ReadOnly to prevent updates from showing up, because things can break if the version of Microsoft.NETCore.App that you reference doesn't match the target framework version of your project. If we change the package so that you can use the latest version of the package with earlier TFMs, then we will probably remove the ReadOnly setting for that reference.
You can also modify the version of the shared framework that is written to runtimeconfig.json by specifying the
RuntimeFrameworkVersionproperty:If this property is defined, then it's value will be used as the version of the shared framework written to runtimeconfig.json. Setting the property won't change which version of the Microsoft.NETCore.App package is referenced and hence compiled against, but I believe there shouldn't be any API changes between the patch versions so that shouldn't matter.
TheRealPiotrP commentedon Jan 6, 2017
If we knew NuGet's preference perhaps the code could be changed to ensure that NuGet prefers the user's choice? Ideally, the default would be set in our .props, then the user's choice would override our default, and then NuGet would prefer the user's choice. @rrelyea @rohit21agrawal is that feasible? Alternatively, could we add the implicit reference in the .targets file so it gets added after the user's choice?
srivatsn commentedon Jan 6, 2017
If we added in the targets, then you can't use the Update syntax to update. Two items is not a good place to be because then every consumer needs to know which one to pick.
TheRealPiotrP commentedon Jan 6, 2017
Two items is the state we were in, right? I think that avoiding the
updatesyntax should be an explicit goal. Folks shouldn't have to think about which one to use for a give Package Reference. Neither is always right and there is no project file artifact that tells us which to use in a given context. The rule seems to be "go figure out if an SDK is adding this reference" which is pretty bad...mlorbetske commentedon Jan 6, 2017
Currently going through the templates updating them to make use of the implicit references. The packageref for libraries going away is nice, but every app has an update to 1.0.3 which defeats the purpose imho. Moreover, users would no longer have a recognizable place to update should they want to move to a newer version (or pin to a specific one & survive behavior changes with default version updates) if we go ahead with making this entirely implicit.
dsplaisted commentedon Jan 6, 2017
The idea behind the implicit references is that folks should generally not need to think about Package References to NETStandard.Library or Microsoft.NETCore.App at all. As much as possible, they should be an implementation detail that's not surfaced to users.
We should instead just update the SDK to implicitly reference 1.0.3 if you're targeting netcoreapp1.0. We have #572 filed for this.
mlorbetske commentedon Jan 6, 2017
Sorry, must have missed #572 in my notifications previously, thanks for moving it up to 1.0.3 by default - when do we expect that to be ready?
I agree with the sentiment that users shouldn't have to worry about it, but I do still worry about the discovery issues for non-VS development environments and (with the current lack of version assertions in projects for particular SDKs) the possibility of having different implicit package references in different contexts.
davidfowl commentedon Jan 6, 2017
Since we float to the latest patch automagically, you don't actually need to update to 1.0.3 to target it. Once you install it, it will be used. That even happens today if you target 1.0.1 but install 1.0.3.
TheRealPiotrP commentedon Jan 6, 2017
Yep, I agree that this should not often be surfaced to users. When it's needed, we would best serve our customers if they didn't need to deal with an unexpected pattern. I'm really worried about users that need to specify the framework version. This
Updatesyntax is only going to be used for PackageReferences in this scenario, AFAIK. People will be very familiar with PackageReferences and will quite naturally useIncludeinstead.If we feel that we cannot make Include work, can we at least fail with a good error message when
Includeis used? Something that enables easy searches and, ideally, tells folks what to do?TheRealPiotrP commentedon Jan 6, 2017
@davidfowl you mean for binding portable apps at runtime? Or are there associated changes for design-time and standalone apps as well?
davidfowl commentedon Jan 6, 2017
Portable applications. Shared frameworks need to use packages to get the implementation until we fix how that works (getting implementations from the shared framework always). We need to think about standalone more here.
dsplaisted commentedon Jan 6, 2017
@piotrpMSFT
Can we just tell people to use the
RuntimeFrameworkVersionproperty in that case instead of changing the package version?mlorbetske commentedon Jan 6, 2017
@dsplaisted also, will there be explicit support added for automatically picking the 1.1.0 packageref (looks like it's just a 1.0 thing currently)?
13 remaining items
davidfowl commentedon Jan 10, 2017
Seems like there are a few issues we need to react to from this change.
PS @natemcmaster wow, that's really nasty.
thesmithee commentedon Jan 10, 2017
@davidfowl yes, the impact this is having is non-trivial for both libs and apps. We need to consider this all-up.
natemcmaster commentedon Jan 10, 2017
Re: #596 (comment)
Part of the issue is that we'll need to touch all of our project files to move from RC.2 to RC.3. If that were the only issue, this would a manageable, though cumbersome, requirement.
The bigger concern we want addressed is that cross-targeting requires this ugliness in the project #596 (comment) or opting out via the DisableImplicitFrameworkReferences property. Both require a high-level knowledge of SDK internals, far beyond what I would expect from the average user.
Plus, I'd echo the concerns @livarcocc mentioned in the original issue about LTS/FTS and complications down the road caused by hardcoding versions into the SDK now.
cdmihai commentedon Jan 10, 2017
@natemcmaster Sounds like lineup files would be adequate here, right? dotnet/msbuild#1493
natemcmaster commentedon Jan 10, 2017
@cdmihai not sure. I'd have to see more details on how lineup files will be implemented.
Eilon commentedon Jan 10, 2017
cc @DamianEdwards @davidfowl - I think this is relevant to the mtg you have later today?
srivatsn commentedon Jan 11, 2017
We've decided to revert the implicit packageref feature until we can make it work fully E2E. Using this issue to track the revert.
srivatsn commentedon Jan 17, 2017
This is now fixed.