Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Sdk property not optional on Unix? #2550

Closed
siegfriedpammer opened this issue Sep 26, 2017 · 3 comments
Closed

Project Sdk property not optional on Unix? #2550

siegfriedpammer opened this issue Sep 26, 2017 · 3 comments
Labels

Comments

@siegfriedpammer
Copy link

Some time ago we migrated our projects to the new build system. (The main csproj see here: https://github.com/icsharpcode/ILSpy/blob/master/ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj)

(Note: On Windows we use ILSpy.sln on Unix we use ICSharpCode.Decompiler.Console.sln)

This works perfectly fine on Windows, however when we try to open/build the project on mac/unix. VSmac and msbuild cannot open the project unless the Sdk="Microsoft.NET.Sdk" is added, however, when we add that on Windows as well, we get some warnings.

\ILSpy\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj(3,3): warning MSB4011: "C:\Program Files\dotnet\sdk\2.0.0\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props" cannot be imported again. It was already imported at "\ILSpy\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj". This is most likely a build authoring error. This subsequent import will be ignored.

Seems like #1392 is not fully supported on Unix.

Is there a way to define the Sdk attribute conditionally (in one single file)? Using a separate csproj file per platform is not a usable workaround as all msbuild projects in the same directory use obj\project.assets.json and conflict with each other (among other problems we've experienced...).

@mrward
Copy link

mrward commented Sep 26, 2017

The VS Mac bug is currently being tracked on bugzilla.

Ignoring VS Mac for now, is there a problem with just using msbuild from the command line if this commit is reverted?

@radical
Copy link
Member

radical commented Sep 26, 2017

I hit other issues trying to build ILSpy.sln with msbuild/mac on the command line. With these changes changes I was able to get it to almost build. But there is other stuff that needs to be fixed in the projects before it will build completely, AFAICS.

@siegfriedpammer
Copy link
Author

siegfriedpammer commented Sep 26, 2017

@radical ILSpy.sln is not intended for use on Unix as it contains WPF projects.

@mrward removing the conditions on the imports fixes the build. Not sure why I needed to add them before. Thanks for the reference on bugzilla.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants