-
Notifications
You must be signed in to change notification settings - Fork 256
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
dotnet pack doesn't choose the right version for ProjectReferences #6209
Comments
Passing This is a common scenario that we are looking to improve for pack, it is confusing that these properties impact dependency projects in scenarios like this. The workaround for this is to set the version of the project using a property that is unique to that project, that will keep dependency projects from using the same version. Example: <PropertyGroup>
<Version Condition=" '$(ProjectAVersion)' != '' ">$(ProjectAVersion)</Version>
</PropertyGroup> |
@emgarten Hum, I am not sure to understand if I need to had this Also what confused me is that it was working before with dotnet 2.0.0 for example. |
No, this property group would be specific to a single project. Think hardcoding the right value into that specific fsproj and leaving the others unchanged. You want a property that only overrides a single fsproj's version property.
This should be all basic MSBuild that is setting and reading the property. Possibly if something else in your build changed how restore is called to make it skip the restore for the fulma this could happen. //cc @rohit21agrawal for pack |
Because before 2.0.0, the CLI did not perform an implicit restore. You should get the same behavior by passing Another workaround would be to explicitly set the version property in the reference project and tell msbuild to take the local property over the global one: So Fulma.fsproj could be changed to
However this also means that you can no longer use |
I didn't really understand all this change related to From your answers, I understand that's the problems is coming from Old
New
This seems to be working, I just don't know if there will be any draws back. Thanks for your answers. |
The idea is that you change for instance <Version>1.0.0-beta-005</Version>
<Version Condition="'$(FulmaVersion)' != ''">$(FulmaVersion)</Version> and <Version>1.0.0-beta-007</Version>
<Version Condition="'$(FulmaExtensionsVersion)'' != ''">$(FulmaExtensionsVersion)</Version> this will allow you to build from any command on any project safely by calling |
Btw I was about to suggest adding EDIT: changed to |
@dasMulli Thanks for the clarification. |
It should be fixed with another PR to choose the right version for project references. It will be available as part of Visual Studio 2017 15.6 preview3 release. |
This is still an issue. This package: ProjectReferences.Common.Services -Version 1.0.2 was packed using: and it behaves as described by the reporter. The solution structure can be reviewed in this repo
Since the workaround that was suggested by @dasMulli doesn't really suite my need, the only thing that's left is to use Nuget references instead of project references although the projects are the part of the same solution. Is anyone aware for a solution/different workaround so that the version is only appended to the project that is being published? |
Hack-around I am using currently is:
I haven't figured out the reason why in this case
Common.Services package version would be overridden by what ever is specified in Note:
|
Any update on this? Does anyone know if Microsoft is going to release a change? |
From @MangelMaxime on November 21, 2017 13:0
Hello, I have a problem with
dotnet pack
command andProjectReferences
resolve version. It was working on dotnet 2.0.0cc @forki
Steps to reproduce
Repo used: /~https://github.com/MangelMaxime/Fulma
Expected behavior
In the nuspec file:
<dependency id="Fulma" version="1.0.0-beta-005" exclude="Build,Analyzers" />
Actual behavior
In the nuspec file:
<dependency id="Fulma" version="0.1.0-beta-007" exclude="Build,Analyzers" />
Environment data
dotnet --info
output:Machine 1:
Machine 2:
This is also failing on my computer under Linux. I don't have access to it ATM.
Edit: Add the repo url
Copied from original issue: dotnet/cli#8073
The text was updated successfully, but these errors were encountered: