Create a NuGet package on build
See original GitHub issueI wanted to create a NuGet package from the latest master so I can actually use this library. But I failed. Here’s what I did:
set AssemblyVersion=2.3.5
set PackageVersion=2.3.5-dev+48e3ba
dotnet restore -v q
cd src\Certes
dotnet publish -c Release --no-restore -nologo -p:AssemblyVersion=%AssemblyVersion% -p:InformationalVersion=%PackageVersion% -p:DebugSymbols=true -p:DebugType=embedded -p:EmbedAllSources=true
dotnet pack -c Release -nologo -p:PackageVersion=%PackageVersion%
This did build the DLL but no package. I tried to set GeneratePackageOnBuild=true
on publish first, as that’s the property I’ve set in my library projects, but it had no effect. Then I found the dotnet pack
command to do it separately, but it fails and can’t find the DLL in the net45 directory when it really is in the netstandard2.0 directory. Very strange.
C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: Das Zielframework "netcoreapp3.0" wird nicht mehr unterstützt und erhält in Zukunft keine Sicherheitsupdates mehr. Weitere Informationen zur Supportrichtlinie finden Sie unter "https://aka.ms/dotnet-core-support". [C:\Source\Web\certes\test\Certes.Tests.Web\Certes.Tests.Web.csproj]
Certes -> C:\Source\Web\certes\src\Certes\bin\Release\netstandard2.0\Certes.dll
Certes -> C:\Source\Web\certes\src\Certes\bin\Release\netstandard2.0\publish\
Certes -> C:\Source\Web\certes\src\Certes\bin\Release\netstandard2.0\Certes.dll
C:\Program Files\dotnet\sdk\5.0.100\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(207,5): error NU5026: Die im Paket einzubeziehende Datei "C:\Source\Web\certes\src\Certes\bin\Release\net45\Certes.dll" wurde auf dem Datenträger nicht gefunden. [C:\Source\Web\certes\src\Certes\Certes.csproj]
Maybe a simple additional build script doesn’t help here and I need to delete and recreate the entire project file to make it work.
How does everybody else use this library in the latest version? Copy the DLL into your project? And all of its dependencies?
Update: I tried to recreate the .csproj file but that won’t build anymore. It can’t find any type from mscorlib anymore. Something is seriously broken with this code that prevents it from building with the usual and simple methods. All those imports look pretty complicated. I’m using the 2.3.4 package on nuget.org now, later features are just not available.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
For info I have also now published
Webprofusion.Certes
: https://www.nuget.org/packages/Webprofusion.Certes/ this version is as used by https://certifytheweb.com and is supported. The packaging update removes .net 452 and the old CLI is no longer part of this build. It will be maintained here: https://github.com/webprofusion/certes@webprofusion-chrisc yes it’s mainly for my own use, the main project here has adjusted some things to target .net 5/6 but my project still targets .net 4.6.2 - use it if you want, or fork your own.