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

Getting local dependencies to add the correct version when dotnet packing #4306

Closed
rohit21agrawal opened this issue Jan 17, 2017 · 5 comments
Assignees
Labels
Functionality:Pack Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug
Milestone

Comments

@rohit21agrawal
Copy link
Contributor

Posted on behalf of @avanderhoorn . Ported from https://github.com/dotnet/cli/issues/5151

Steps to reproduce

Executed command

dotnet pack .\src\Glimpse.Common\Glimpse.Common.csproj --configuration Release --version-suffix beta2-123
dotnet pack .\src\Glimpse.Server\Glimpse.Server.csproj --configuration Release --version-suffix beta2-123

Target Glimpse.Common.csproj

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
  <PropertyGroup>
    <AssemblyTitle>Glimpse Common</AssemblyTitle>
    <VersionPrefix>2.0.0</VersionPrefix>
    <TargetFrameworks>net451;netstandard1.6</TargetFrameworks>
    <RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64</RuntimeIdentifiers>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <AssemblyName>Glimpse.Common</AssemblyName>
  </PropertyGroup>
...

Target Glimpse.Server.csproj

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
  <PropertyGroup>
    <AssemblyTitle>Glimpse Server</AssemblyTitle>
    <VersionPrefix>2.0.0</VersionPrefix>
    <TargetFrameworks>net451;netstandard1.6</TargetFrameworks>
    <RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.23-x64;opensuse.13.2-x64</RuntimeIdentifiers>
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <AssemblyName>Glimpse.Server</AssemblyName>
  </PropertyGroup>
  <ItemGroup>
    <ProjectReference Include="..\Glimpse.Common\Glimpse.Common.csproj" />
  </ItemGroup>
...

Resulting Glimpse.Server.nuspec

<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>Glimpse Server</id>
    <version>2.0.0-beta2-123</version>
    ...
    ...
    <dependencies>
      <group targetFramework=".NETFramework4.5.1">
        <dependency id="Glimpse.Common" version="1.0.0" exclude="Build,Analyzers" />
        ...
      </group>
...

Expected behavior

I want the version of the Glimpse.Common dependency in above Glimpse.Server.nuspec to be 2.0.0-beta2-123 vs instead 1.0.0.

Previously with project.json this was all taken care of with the with the following pack.cmd and by specifying dependencies like this. But I can't figure out how to replicate these results with the new .csproj setup. Here is my reworked pack.cmd.

Actual behavior

Shown above in the resulting Glimpse.Server.nuspec.

Environment data

.NET Command Line Tools (1.0.0-preview4-004233)

Product Information:
 Version:            1.0.0-preview4-004233
 Commit SHA-1 hash:  8cec61c6f7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\1.0.0-preview4-004233
@rohit21agrawal
Copy link
Contributor Author

rohit21agrawal commented Jan 18, 2017

@avanderhoorn this is the bug that needs to be fixed for this to work : #3901

The timeframe for this is RTM, and once this is fixed, your scenario would work exactly as you expect it to.

@avanderhoorn
Copy link

Thanks! Is there any workaround in the mean time?

@rohit21agrawal
Copy link
Contributor Author

@avanderhoorn unfortunately, no. The best you can do right now is to use the generated nuspec file in your obj folder, modify it manually and use it again to get the right package.

@rohit21agrawal
Copy link
Contributor Author

I have unblocked @avanderhoorn which is basically to run a restore with /p:VersionSuffix argument before packing.

At this point, this is basically the dupe of : #4337

@rohit21agrawal rohit21agrawal added the Resolution:Duplicate This issue appears to be a Duplicate of another issue label Jan 20, 2017
@avanderhoorn
Copy link

avanderhoorn commented Jan 20, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Pack Resolution:Duplicate This issue appears to be a Duplicate of another issue Type:Bug
Projects
None yet
Development

No branches or pull requests

3 participants