Skip to content

Instantly share code, notes, and snippets.

@iwillspeak
Last active Aug 20, 2020
Embed
What would you like to do?
.NET NU5104 NoWarn Build Errors
using System;
namespace bugz
{
public class Class1
{
// This package used to be packable with the .NET Core 3.1.301 SDK but
// packaging fails with the .NET Core 3.1.401 SDK. The exit code from
// `dotnet pack` is now 1 indicating failure. This has prevented
// release builds of some of our libraries.
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.2.3</Version>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00011" NoWarn="NU5104" />
</ItemGroup>
</Project>
#! /usr/bin/env bash
set -euo pipefail
function run_with_sdk()
{
sdk_tag=$1
echo ""
echo "with SDK $sdk_tag"
rm -rf bin/ obj/
docker run -v `pwd`:/test mcr.microsoft.com/dotnet/core/sdk:$sdk_tag bash -c 'if dotnet pack /test; then echo ++ passed. Exit code: $? ++; else echo -- failed. Exit code: $? --; fi'
}
run_with_sdk 3.1.201
run_with_sdk 3.1.301
run_with_sdk 3.1.302
run_with_sdk 3.1.401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment