Skip to content

Instantly share code, notes, and snippets.

@iwillspeak
Last active August 20, 2020 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iwillspeak/2d503703a579f5623fd5e5fb410a29f1 to your computer and use it in GitHub Desktop.
Save iwillspeak/2d503703a579f5623fd5e5fb410a29f1 to your computer and use it in GitHub Desktop.
.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