Cpo Design

Creating nuget package gotchas

Pavel Svarc Saturday, September 8, 2018 2:38 PM

 

1, Compile to nuget package

2, Update version of nuget package

3, Push version to nuget server

 

Command to run the nuget packaging is

 

dotnet pack /p:Nuspecfile=EFCoreTemporalSupport.nuspec

 

once the command gets executed the following output will be displayed

 

 

c:\Agent\_work\1\s>dotnet pack /p:Nuspecfile=EFCoreTemporalSupport.nuspec Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. EFCoreTemporalSupport -> c:\Agent\_work\1\s\bin\Debug\netstandard2.0\EFCoreTemporalSupport.dll Successfully created package 'c:\Agent\_work\1\s\bin\Debug\EFCoreTemporalSupport.0.0.1.nupkg'.

 

 

Now in order to get the nuget version actually updated you need to add the following code into your project

 

A Command that actually generates correct version for our package

c:\Agent\_work\1\s>dotnet pack /p:Nuspecfile=EFCoreTemporalSupport.nuspec -c Release /p:PackageVersion=2.1.0 Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. CSC : warning CS8032: An instance of analyzer Microsoft.EntityFrameworkCore.RawSqlStringInjectionDiagnosticAnalyzer cannot be created from C:\Users\pavel\.nuget\packages\microsoft.entityframeworkcore.analyzers\2.1.1\analyzers\dotnet\cs\Microsoft.EntityFrameworkCore.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.. [c:\Agent\_work\1\s\EFCoreTemporalSupport.csproj] EFCoreTemporalSupport -> c:\Agent\_work\1\s\bin\Release\netstandard2.0\EFCoreTemporalSupport.dll NuspecProperties: ;id=EFCoreTemporalSupport;config=Release;version=2.1.0;description=Package Description;authors=EFCoreTemporalSupport Successfully created package 'c:\Agent\_work\1\s\bin\Release\EFCoreTemporalSupport.2.1.0.nupkg'.

 

 

 

 

 

Related posts

Currenlty there are no related articles.