3

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.

6
  • Mono on where? Windows? Linux? Which version of Mono? Did you build in MonoDevelop or with xbuild? Try xbuild at the terminal and see if it works. Commented Jan 26, 2016 at 13:24
  • "if you can't help that's ok. but why close? " - whilst someone could potentially ask a question about what's the airspeed of an unladen swallow and potentially also obtain an answer (even for European swallows), it's probably off-topic for SO. :) See How to Ask; and faq. Good luck! Commented Jan 26, 2016 at 13:35
  • what version of MonoDevelop are you using? Commented Jan 27, 2016 at 8:06
  • 1
    @MickyD Strongly disagree with your assessment, this is a completely valid, programming-related question. This is a perfect fit in my opinion. Commented Dec 3, 2016 at 20:57
  • 1
    @MickyD building code is related to writing code. Whether or not there is code it the question, it is coding related ... Commented Dec 4, 2016 at 0:46

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

1 Comment

And what do you do after getting the result from grep IncludeRoslynCompilerFilesToItemGroup * -R ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.