Conditional compilation symbol for a .NET Core class library

后端 未结 3 2007
隐瞒了意图╮
隐瞒了意图╮ 2021-01-11 14:45

I have created a .NET Core R2 class library and have some common code that I use for several different platforms.

Some of the code is not valid in the .NET Core plat

3条回答
  •  既然无缘
    2021-01-11 15:07

    There is a bug in the .NET Core xproj project type. When you define a conditional compilation symbol through the project settings, it defines the element as "defines", but this is incorrect. It should create an element called "define". You can work around the issue by editing the project.json manually.

    I have logged this bug with Microsoft in two places. Please take the time to register your annoyance with Microsoft so that they eventually get around to fixing it and not causing this grief for others.

    This thread has a detailed explanation of the problem with steps to repro, and screenshots: https://github.com/dotnet/cli/issues/4022#issuecomment-238777946

    This is the Microsoft Connect bug report: https://connect.microsoft.com/VisualStudio/feedbackdetail/view/2983351/conditional-compilation-symbols-broken-in-net-core-projects#tabs

提交回复
热议问题