Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Error in Mono Develop

Tags:

c#

mono

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.

like image 748
Nirav Solanki Avatar asked Mar 19 '26 01:03

Nirav Solanki


1 Answers

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.

like image 158
Michael Wasser Avatar answered Mar 20 '26 14:03

Michael Wasser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!