Nirav Solanki
Nirav Solanki

Reputation: 89

Build Error in Mono Develop

I tried to build my existing Mvc application with Mono by changing targeting framework to Mono/.Net 4.5 in Mono Develop. That gives me build error

Build failed. Item has already been added. Key in dictionary: 'Path' Key being added: 'PATH'

Build: 1 error, 0 warnings

I tried to make new project that also gave the same error. I also tried to updating nuget package but that also did not works.

Upvotes: 3

Views: 1405

Answers (1)

Michael Wasser
Michael Wasser

Reputation: 1837

This question is somewhat out of date, but I thought I'd include an answer to give folks a thread to follow.

I found several VS 2015 templates had elements in the projects that would cause this type of issue in sub-build files for mono. For example, references related to Rosyln or Microsoft.CodeDom.Providers.DotNetCompilerPlatform. My particular project didn't need the latter, and I removed the related references to resolve the issue. The full error was

Error building target IncludeRoslynCompilerFilesToItemGroup: 
  Item has already been added. Key in dictionary: 'Link'  Key being added: 'Link'

I figured out that this was related to my Microsoft.CodeDom.Providers.DotNetCompilerPlatform by greping for the target, e.g.

grep IncludeRoslynCompilerFilesToItemGroup * -R

to find the offending package and figuring out if I could remove the code reference.

Upvotes: 6

Related Questions