Pack throws exception if IncludeSource is used in a project with multiple TFMs #4536

Closed
srivatsn opened this Issue Feb 8, 2017 · 8 comments

Comments

Projects
None yet
4 participants
@srivatsn

srivatsn commented Feb 8, 2017

From @niemyjski on February 8, 2017 15:41

I'm running VS2017 RC3 (Latest) and I'm seeing this randomly when I build my solution or the Foundatio.Redis package.

Just clone (https://github.com/exceptionless/foundatio) and try building different projects / run the tests

Severity	Code	Description	Project	File	Line	Suppression State
Error	MSB4018	The "PackTask" task failed unexpectedly.
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at NuGet.Build.Tasks.Pack.PackTaskLogic.GetSourceFiles(IPackTaskRequest`1 request, String currentProjectDirectory)
   at NuGet.Build.Tasks.Pack.PackTaskLogic.GetPackArgs(IPackTaskRequest`1 request)
   at NuGet.Build.Tasks.Pack.PackTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	Foundatio	C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets	104	

Copied from original issue: dotnet/sdk#838

@srivatsn

This comment has been minimized.

Show comment
Hide comment
@srivatsn

srivatsn Feb 8, 2017

From @niemyjski on February 8, 2017 15:54

Also, is there a good place to log an issue with the VS Test runner? I can't seem to be able to profile any unit tests either. And My redis unit tests aren't discoverable now either :\

srivatsn commented Feb 8, 2017

From @niemyjski on February 8, 2017 15:54

Also, is there a good place to log an issue with the VS Test runner? I can't seem to be able to profile any unit tests either. And My redis unit tests aren't discoverable now either :\

@niemyjski

This comment has been minimized.

Show comment
Hide comment
@niemyjski

niemyjski Feb 8, 2017

This issue is so annoying I wish I could go back to the previous RC

This issue is so annoying I wish I could go back to the previous RC

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 8, 2017

Contributor

@niemyjski what arguments are you passing to pack foundation.redis ?

Contributor

rohit21agrawal commented Feb 8, 2017

@niemyjski what arguments are you passing to pack foundation.redis ?

@rohit21agrawal rohit21agrawal self-assigned this Feb 8, 2017

@rohit21agrawal rohit21agrawal added this to the 4.0 RTM milestone Feb 8, 2017

@niemyjski

This comment has been minimized.

Show comment
Hide comment
@niemyjski

niemyjski Feb 8, 2017

@rohit21agrawal I have the new feature to package on build defined in the csproj... But this is just from within Visual Studio when I right click a project and select build or click run all unit tests (which does a build). It's super annoying

@rohit21agrawal I have the new feature to package on build defined in the csproj... But this is just from within Visual Studio when I right click a project and select build or click run all unit tests (which does a build). It's super annoying

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 8, 2017

Contributor

@niemyjski figured out..this is a bug in the Pack code when IncludeSource is set to true. while i am figuring out the exact cause, you can work around by setting this to false in your project.

Contributor

rohit21agrawal commented Feb 8, 2017

@niemyjski figured out..this is a bug in the Pack code when IncludeSource is set to true. while i am figuring out the exact cause, you can work around by setting this to false in your project.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@niemyjski

This comment has been minimized.

Show comment
Hide comment
@niemyjski

niemyjski Feb 8, 2017

Thanks, seems kinda odd that building of packages would happen so often even if nothing changed. Especially when I want to just run tests.

Thanks, seems kinda odd that building of packages would happen so often even if nothing changed. Especially when I want to just run tests.

@rohit21agrawal

This comment has been minimized.

Show comment
Hide comment
@rohit21agrawal

rohit21agrawal Feb 8, 2017

Contributor

@niemyjski i agree. we plan to fix this soon : #4363

Contributor

rohit21agrawal commented Feb 8, 2017

@niemyjski i agree. we plan to fix this soon : #4363

@rohit21agrawal rohit21agrawal changed the title from PackTask" task failed unexpectedly. System.ArgumentException: An item with the same key has already been added. to Pack throws exception if IncludeSource is used in a project with multiple TFMs Feb 8, 2017

@rrelyea rrelyea reopened this Feb 9, 2017

@rrelyea rrelyea closed this Feb 9, 2017

@martincostello martincostello referenced this issue in martincostello/browserstack-automate Feb 13, 2017

Merged

Migrate to MSBuild from project.json #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment