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

Validate RuntimeIdentifiers during build #4164

Open
rainersigwald opened this issue Jan 13, 2020 · 0 comments
Open

Validate RuntimeIdentifiers during build #4164

rainersigwald opened this issue Jan 13, 2020 · 0 comments

Comments

@rainersigwald
Copy link
Contributor

@rainersigwald rainersigwald commented Jan 13, 2020

From @jochenz on Friday, January 10, 2020 1:01:44 PM

NuGet uses RuntimeIdentifiers to prohibit restoring packages on unsupported architectures. For example, you can't restore a linux library on a Windows 10 machine.

However, msbuild doesn't seem to validate those runtime requirements. I can perfectly create a Linux-only library:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <RuntimeIdentifiers>linux</RuntimeIdentifiers>
  </PropertyGroup>
</Project>

And reference that in a Windows-only application:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\MyLinuxLib\MyLinuxLib.csproj" />
  </ItemGroup>

</Project>

That doesn't seem to make sense to me and it looks like msbuild should be capable of detecting these inconsistencies.

Copied from original issue: microsoft/msbuild#5044

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.