question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create a NuGet package on build

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
webprofusion-chrisccommented, Mar 17, 2021

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

0reactions
webprofusion-chrisccommented, Jan 10, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a package using the nuget.exe CLI
A detailed guide on designing and creating a NuGet package, including files and versioning.
Read more >
Creating a Nuget Package - Step by Step
This is done by running nuget.exe with the -Set repositoryPath parameter. Your packages folder is typically in the root folder of your Solution, ......
Read more >
How To Create and Publish NuGet Package Using Visual ...
Right-click on the project and go to project properties. Go to the Package tab and provide the Package ID, Title, Package version, Author ......
Read more >
create-and-publish-a-package-using-visual-studio.md
Expand the Package node, select General, and then select Generate NuGet package on build. :::image type="content" source="media/qs-create-vs- ...
Read more >
Creating a Nuget Package | Wiliam Blog
In command line or PowerShell, navigate to your project directory. Run: nuget pack Nuget.Package.Name.nuspec. If all goes well you should now ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found