{"action":"created","issue":{"url":"https://api.github.com/repos/NuGet/Home/issues/4337","repository_url":"https://api.github.com/repos/NuGet/Home","labels_url":"https://api.github.com/repos/NuGet/Home/issues/4337/labels{/name}","comments_url":"https://api.github.com/repos/NuGet/Home/issues/4337/comments","events_url":"https://api.github.com/repos/NuGet/Home/issues/4337/events","html_url":"https://github.com/NuGet/Home/issues/4337","id":201964673,"number":4337,"title":"dotnet pack - version suffix missing from ProjectReference","user":{"login":"natemcmaster","id":2696087,"avatar_url":"https://avatars3.githubusercontent.com/u/2696087?v=3","gravatar_id":"","url":"https://api.github.com/users/natemcmaster","html_url":"https://github.com/natemcmaster","followers_url":"https://api.github.com/users/natemcmaster/followers","following_url":"https://api.github.com/users/natemcmaster/following{/other_user}","gists_url":"https://api.github.com/users/natemcmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/natemcmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natemcmaster/subscriptions","organizations_url":"https://api.github.com/users/natemcmaster/orgs","repos_url":"https://api.github.com/users/natemcmaster/repos","events_url":"https://api.github.com/users/natemcmaster/events{/privacy}","received_events_url":"https://api.github.com/users/natemcmaster/received_events","type":"User","site_admin":false},"labels":[{"id":330852328,"url":"https://api.github.com/repos/NuGet/Home/labels/Area:%20Pack","name":"Area: Pack","color":"e11d21","default":false},{"id":460341686,"url":"https://api.github.com/repos/NuGet/Home/labels/NeedsTriageDiscussion","name":"NeedsTriageDiscussion","color":"f7c6c7","default":false},{"id":180116450,"url":"https://api.github.com/repos/NuGet/Home/labels/Type:Bug","name":"Type:Bug","color":"207de5","default":false}],"state":"open","locked":false,"assignee":{"login":"rohit21agrawal","id":1857490,"avatar_url":"https://avatars1.githubusercontent.com/u/1857490?v=3","gravatar_id":"","url":"https://api.github.com/users/rohit21agrawal","html_url":"https://github.com/rohit21agrawal","followers_url":"https://api.github.com/users/rohit21agrawal/followers","following_url":"https://api.github.com/users/rohit21agrawal/following{/other_user}","gists_url":"https://api.github.com/users/rohit21agrawal/gists{/gist_id}","starred_url":"https://api.github.com/users/rohit21agrawal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohit21agrawal/subscriptions","organizations_url":"https://api.github.com/users/rohit21agrawal/orgs","repos_url":"https://api.github.com/users/rohit21agrawal/repos","events_url":"https://api.github.com/users/rohit21agrawal/events{/privacy}","received_events_url":"https://api.github.com/users/rohit21agrawal/received_events","type":"User","site_admin":false},"assignees":[{"login":"rohit21agrawal","id":1857490,"avatar_url":"https://avatars1.githubusercontent.com/u/1857490?v=3","gravatar_id":"","url":"https://api.github.com/users/rohit21agrawal","html_url":"https://github.com/rohit21agrawal","followers_url":"https://api.github.com/users/rohit21agrawal/followers","following_url":"https://api.github.com/users/rohit21agrawal/following{/other_user}","gists_url":"https://api.github.com/users/rohit21agrawal/gists{/gist_id}","starred_url":"https://api.github.com/users/rohit21agrawal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rohit21agrawal/subscriptions","organizations_url":"https://api.github.com/users/rohit21agrawal/orgs","repos_url":"https://api.github.com/users/rohit21agrawal/repos","events_url":"https://api.github.com/users/rohit21agrawal/events{/privacy}","received_events_url":"https://api.github.com/users/rohit21agrawal/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/NuGet/Home/milestones/55","html_url":"https://github.com/NuGet/Home/milestone/55","labels_url":"https://api.github.com/repos/NuGet/Home/milestones/55/labels","id":2367160,"number":55,"title":"4.3 - 3/6 thru 3/24","description":"sprint 115's work for 4.3","creator":{"login":"rrelyea","id":8865080,"avatar_url":"https://avatars2.githubusercontent.com/u/8865080?v=3","gravatar_id":"","url":"https://api.github.com/users/rrelyea","html_url":"https://github.com/rrelyea","followers_url":"https://api.github.com/users/rrelyea/followers","following_url":"https://api.github.com/users/rrelyea/following{/other_user}","gists_url":"https://api.github.com/users/rrelyea/gists{/gist_id}","starred_url":"https://api.github.com/users/rrelyea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrelyea/subscriptions","organizations_url":"https://api.github.com/users/rrelyea/orgs","repos_url":"https://api.github.com/users/rrelyea/repos","events_url":"https://api.github.com/users/rrelyea/events{/privacy}","received_events_url":"https://api.github.com/users/rrelyea/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":14,"state":"open","created_at":"2017-03-06T20:10:01Z","updated_at":"2017-04-03T16:15:00Z","due_on":"2017-03-24T07:00:00Z","closed_at":null},"comments":15,"created_at":"2017-01-19T20:18:48Z","updated_at":"2017-04-12T22:41:21Z","closed_at":null,"body":"Follow up to https://github.com/NuGet/Home/issues/3953\r\n\r\n**Repro**\r\nProjectA has project reference to ProjectB.\r\nProjectB contains `<VersionPrefix>3.0.0</VersionPrefix>`\r\n`dotnet pack ProjectA.csproj --version-suffix build001`\r\n\r\n**Expected**\r\nProjectA.nupkg has dependency on ProjectB **3.0.0-build001**\r\n\r\n**Actual**\r\nProjectA.nupkg has dependency on ProjectB **3.0.0**\r\n\r\n**Details**\r\nUsing 4.0.0-rc3\r\nWorked in project.json, doesn't work here.\r\nWorkaround: `msbuild \"/t:Restore;Pack\" /p:VersionSuffix=build001\"`. Set VersionSuffix property on all projects during restore, not pack."},"comment":{"url":"https://api.github.com/repos/NuGet/Home/issues/comments/293727808","html_url":"https://github.com/NuGet/Home/issues/4337#issuecomment-293727808","issue_url":"https://api.github.com/repos/NuGet/Home/issues/4337","id":293727808,"user":{"login":"ericwj","id":9473119,"avatar_url":"https://avatars1.githubusercontent.com/u/9473119?v=3","gravatar_id":"","url":"https://api.github.com/users/ericwj","html_url":"https://github.com/ericwj","followers_url":"https://api.github.com/users/ericwj/followers","following_url":"https://api.github.com/users/ericwj/following{/other_user}","gists_url":"https://api.github.com/users/ericwj/gists{/gist_id}","starred_url":"https://api.github.com/users/ericwj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericwj/subscriptions","organizations_url":"https://api.github.com/users/ericwj/orgs","repos_url":"https://api.github.com/users/ericwj/repos","events_url":"https://api.github.com/users/ericwj/events{/privacy}","received_events_url":"https://api.github.com/users/ericwj/received_events","type":"User","site_admin":false},"created_at":"2017-04-12T22:41:21Z","updated_at":"2017-04-12T22:41:21Z","body":"There is in fact another problem being that whatever I tried, unless `VersionSuffix` is actually on disk, `AssemblyInformationalVersion` will not match the version used during build.\r\n\r\nThat is after realizing that unless you actually do a `dotnet clean` with the same configuration as the one you'll use to restore+build+pack+push, this value is not updated at all. It gets written to `obj\\$(Configuration)\\$(TargetFramework)\\$(ProjectName)\\$(AssemblyName).AssemblyInfo.cs` and this file is never updated unless it is deleted first (by running clean or build /t:Clean) as far as I can tell.\r\n\r\n```XML\r\n<Project>\r\n\t<PropertyGroup>\r\n\t\t<VersionPrefix>1.0.0</VersionPrefix>\r\n\t\t<VersionSuffix>alpha</VersionSuffix>\r\n\t</PropertyGroup>\r\n</Project>\r\n```\r\n```C#\r\nvar aiv = typeof(SomeClassInMyProjectReferenceLibrary).GetTypeInfo().Assembly\r\n\t.GetCustomAttribute<AssemblyInformationalVersionAttribute>()\r\n\t.InformationalVersion;\r\nConsole.WriteLine(aiv);\r\n```\r\n```\r\nrem Simulate working in Visual Studio\r\ndotnet clean\r\ndotnet restore\r\ndotnet build\r\n\r\nrem Now prepare to pack and push\r\ndotnet restore /p:VersionSuffix=alpha-001\r\ndotnet build /p:VersionSuffix=alpha-001\r\ndotnet run --no-build\r\n```\r\nOutput: 1.0.0-alpha\r\n```\r\nrem Now also clean\r\ndotnet clean\r\ndotnet restore /p:VersionSuffix=alpha-001\r\ndotnet build /p:VersionSuffix=alpha-001\r\ndotnet run --no-build\r\n```\r\nOutput: 1.0.0-alpha\r\n\r\nThis is probably why say EFCore uses a file called Version.props in the build which comes with the warning that it might be overwritten: [link](https://github.com/aspnet/EntityFramework/blob/dev/version.props)\r\n```\r\n# Add <Import Project=\"..\\..\\build\\Version.props\"/> to .csproj\r\n$v = [xml]::new()\r\n$v.Load(\".\\build\\Version.props\")\r\n$v.Project.PropertyGroup.VersionSuffix += \"-001\"\r\n$v.Save(\".\\build.Version.props\")\r\ndotnet clean\r\ndotnet restore\r\ndotnet build\r\ndotnet run --no-build\r\n```\r\nOutput: 1.0.0-alpha-001\r\n\r\nYou'd have to wrap this in a try ... finally where you restore the original VersionSuffix since if the build fails a few times and then succeeds, you might end up with 1.0.0-alpha-001-001-001-001-001. 🥇 "}}
{"actor":{"display_login":"ericwj"}}