-
Notifications
You must be signed in to change notification settings - Fork 197
Fix NuGet package publishing [9.0.0-beta8] #498
Comments
Possible solution for this problem could be to overwrite assembly version of the dlls during the build. To determine correct version and informational version of the dlls, steps:
- name: Checkout git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
id: gitversion And the build action can be modified to something like: - name: Build solution
run: dotnet build --no-restore -c Release -p:Version=${{ steps.gitversion.outputs.majorMinorPatch }}.$GITHUB_RUN_ID -p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion}} I have used For the current branch e3876b, running GitVersion.exe gives following results: {
"Major": 9,
"Minor": 0,
"Patch": 0,
"PreReleaseTag": "beta.8",
"PreReleaseTagWithDash": "-beta.8",
"PreReleaseLabel": "beta",
"PreReleaseLabelWithDash": "-beta",
"PreReleaseNumber": 8,
"WeightedPreReleaseNumber": 8,
"BuildMetaData": null,
"BuildMetaDataPadded": "",
"FullBuildMetaData": "Branch.dev.Sha.e3876b1da84fc734febb4ac8ba2d486efb5a6292",
"MajorMinorPatch": "9.0.0",
"SemVer": "9.0.0-beta.8",
"LegacySemVer": "9.0.0-beta8",
"LegacySemVerPadded": "9.0.0-beta0008",
"AssemblySemVer": "9.0.0.0",
"AssemblySemFileVer": "9.0.0.0",
"FullSemVer": "9.0.0-beta.8",
"InformationalVersion": "9.0.0-beta.8+Branch.dev.Sha.e3876b1da84fc734febb4ac8ba2d486efb5a6292",
"BranchName": "dev",
"EscapedBranchName": "dev",
"Sha": "e3876b1da84fc734febb4ac8ba2d486efb5a6292",
"ShortSha": "e3876b1",
"NuGetVersionV2": "9.0.0-beta0008",
"NuGetVersion": "9.0.0-beta0008",
"NuGetPreReleaseTagV2": "beta0008",
"NuGetPreReleaseTag": "beta0008",
"VersionSourceSha": "e3876b1da84fc734febb4ac8ba2d486efb5a6292",
"CommitsSinceVersionSource": 0,
"CommitsSinceVersionSourcePadded": "0000",
"UncommittedChanges": 0,
"CommitDate": "2023-01-25"
} |
I tried to set it with - name: Create Release NuGet package
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
VERSION="${VERSION//v}"
dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -p:Version=$VERSION -p:InformationalVersion=$VERSION -o ./nuget So that should set the version, but no luck yet. It still shows 6.0.0 :-( |
@mivano I made a pull request where I removed Just a note regarding: dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -p:Version=$VERSION -p:InformationalVersion=$VERSION -o ./nuget Part Update: actually, I just discovered that I assume that this will be enough: - name: Create Release NuGet package
run: |
arrTag=(${GITHUB_REF//\// })
VERSION="${arrTag[2]}"
VERSION="${VERSION//v}"
dotnet pack -v normal -c Release --include-symbols --include-source -p:Version=$VERSION -o ./nuget |
All this looks really good now! Thanks also to you for the support. I will test the package with .NET (Core) and .NET Framework projects tomorrow during the day and let you know how it went. |
@mivano With After some reading and testing new package builds on my dev machine, it seems that the issue is caused by property in <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> Now it's explicitly set to false, no matter on which operating system is NuGet package built. I only tested building a new version of NuGet package with this setting on Windows 10, where everything works fine, after I pull new package into my projects (.NET Framework), but I hope it works on Linux build server as well. Change is in this PR: #504 |
…ssue of assemblies from public NuGet package: (#504) > Could not load file or assembly 'Serilog.Formatting.Elasticsearch' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)" Co-authored-by: Nenad Vicentic <[email protected]>
Keeps an interesting issue that signing :-) I just pushed the beta12 to nuget. |
Looks like the serilog main library still has the same (https://github.com/serilog/serilog/blob/dev/Directory.Build.props) although it uses appveyor as its build agent. |
@mivano The version
I assume that they are using Windows machine for CI build, while we are using Linux. I can only guess that they disabled signing on Linux because it did not work at the time, or they had some specific scenario when development is done on Linux box (or inside of Linux Docker container). There is only one little thingy, NuGet "thinks" that I would suggest two things:
|
Great! I updated the readme with the suggested text to make it make clear. For the package version; I had not anticipated that we would reach 12 otherwise I would have upped the version or prefixed it :-). I will create a rc release now. |
Package is available: https://www.nuget.org/packages/Serilog.Sinks.Elasticsearch/9.0.0-rc1 |
@mivano I put 4 apps on prod with RC1. Two .NET Framework 4.8, two .NET 7.0. All go against Elasticsearch 7.x server. From my point of view, this is mainly to test if everything is OK under a load and it looks good so far. Let's give it another day. |
@mivano The logging is working fine on production with RC1. Tested with 5 different apps against Elasticsearch 7.x. One of the apps is logging quite intensively. There were no issues. From my point of view, we can release of |
That is great news! I will create the release package. |
* Create codeql-analysis.yml (#370) * fix: Correct comment about default TypeName (#393) The default TypeName was changed to '_doc' in #298 * Proper handling of TypeName = null from appsettings.json (#420) Co-authored-by: Marius Wingerei <[email protected]> * Add `ElasticsearchSinkOptions.BufferFileRollingInterval` option (#416) * Add `ElasticsearchSinkOptions.BufferFileRollingInterval` option - Using this option we can customize buffer file rolling interval. The default is `RollingInterval.Day` (so no changes here). In some cases higher granularity may be needed. - Changed regular expression for FileSet to get buffer files to support different rolling interval file name formats - from Infinite to Minute. All of them are different amount of digits representing date - 0(Infinite), 4(Year),..., 12 (Minute). So replaced expression part for day format `(?<date>\\d{8})` with the expression for all interval date `(?<date>\\d{0,12})`. * Add tests for the desired functionality, which fail now. - Return code to support only Daily rolling interval - Add RollingIntervalExtensions.cs (origin: Serilog.Sinks.File) with InternalVisible attribute to be able to test - Add InternalVisible to FileSet.cs to be able to test it - Sign tests assembly the same way as Serilog.Sinks.Elasticsearch for InternalVisible to work * Support different rolling intervals for DurableElasticsearchSink rolling files. - Make support only for intervals like Day, Hour, Minute. As for less frequent intervals we cannot get specific date (specific day) for passing to _getIndexForEvent in `ElasticsearchPayloadReader`. - Support handling rolling files for different intervals in `ElasticsearchPayloadReader` and `FileSet` by using corresponding formats and search patterns. - Add tests of changed code - for `ElasticsearchPayloadReader` and `FileSet` * Remove redundant spaces * Fix internal or IntelliSense typos (#406) Cleaning up a few very minor typos in internal methods or exposed via IntelliSense: * "semi column" -> "semi-colon" * "preforming" -> "performing" * "CreatePlayLoad" -> "CreatePayload" Co-authored-by: Bo Flynn <[email protected]> * Clean package sources * clean obsolete .net versions * updated packages * added dependabot * Bump actions/setup-dotnet from 1 to 2 (#431) Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 1 to 2. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](actions/setup-dotnet@v1...v2) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/checkout from 2 to 3 (#427) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/cache from 2 to 3 (#429) Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@v2...v3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/download-artifact from 2 to 3 (#424) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v2...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * added dependencies * copy local files * updating versions * publish test results * remove old nuspec and updated icons * added icon * updates * fix build * multiple packages * name * cicd * skip test for now as it is flaky * version * Names * use correct folder * older version * diffferent way of pushing * enviroment * Remove app veyor and dotnet-version * Use repo owner * use dotnet nuget * logging * remove @ * --skip-duplicate * update project url * Updated changelog * paths * use correct output path * remove the source * skip duplicates * Bump actions/setup-dotnet from 2 to 3.0.2 (#478) Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 2 to 3.0.2. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](actions/setup-dotnet@v2...v3.0.2) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update cicd.yaml * Bump actions/download-artifact from 1 to 3 (#439) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 1 to 3. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v1...v3) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/upload-artifact from 2 to 3 (#438) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v2...v3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update cicd.yaml * fix file references in the Visual Studio Solution file. (#461) Co-authored-by: Nenad Vicentic <[email protected]> * Bump actions/setup-dotnet from 3.0.2 to 3.0.3 (#487) Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](actions/setup-dotnet@v3.0.2...v3.0.3) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump github/codeql-action from 1 to 2 (#426) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Automatically handle `TypeName` parameter for different versions of Elasticsearch (<7, 7 or higher) (#462) * fix file references in the Visual Studio Solution file. * Do not set `TypeName` by default any more. * last version of Elasticsearch that supported user-defined `_type` field - v6.8.x is running out of support on 2022-02-10 (https://www.elastic.co/support/eol) * Automatically handle `ElasticsearchSinkOptions.TypeName` for different versions Elasticsearch (<7, 7+) when `ElasticsearchSinkOptions.DetectElasticsearchVersion` is enabled. * Add unit test for automatic settings of `TypeName` when `DetectElasticsearchVersion` is set to `true`. - Two methods used - instantiate `ElasticsearchSinkState` directly and via `LoggerConfiguration` * Add Elasticsearch v8 template + parsing of Elasticsearch major version to `int` + decision branch for which version of index-template API to use + removal of obsolete `ElasticsearchTemplateProvider.GetTemplate(...)` method overload. * Upgrade to .NET 6.0 and update test-frameworks related NuGet pacakges * Upgrade to Elasticsearch.NET 7.17.5 + handle new "preflight" request https://discuss.elastic.co/t/the-client-is-unable-to-verify-that-the-server-is-elasticsearch-due-to-an-unsuccessful-product-check-call-some-functionality-may-not-be-compatible-if-the-server-is-running-an-unsupported-product/310969/9 "The 7.16 client performs a pre-flight GET request to the root URL of the server before the first request.". * Make `ConnectionStub` a bit more robust . * Use `System.Version` to parse Elasticsearch server version number (similar to what `Elasticsearch.Net` does) * Update NuGet packages * Replace obsolete NuGet package `Serilog.Sinks.ColoredConsole` with `Serilog.Sinks.Console` * Update `Serilog.Sinks.PeriodicBatching` package and reimplent `ElasticsearchSink` so that it does not use obsolete `PeriodicBatchingSink` constructor. * Better handling of Elasticsearch server version number in mocked `ConnectionStub` * Cleanup: refactor to use single `JsonEquals` method. * Turn on `DetectElasticSearchVersion` option by default. Assume version 7 on fallback. * Cleanup: remove unused namespaces * Cleanup: move `ElasticsearchSinkTestsBase` into `Stubs` subfolder. * Refactor: extract `ConnectionStub` into a separate file. * Fix: json comparison in .NET Framework 4.6+ * Run unit-tests on multiple .NET frameworks. * Cleanup: remove unused NUnit runner package. * Use newer, built-in compilation constants. https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives#conditional-compilation * Use standard MSBuild property `IsPackable` for clarity. * Cleanup: remove unused package refrence. * Update GitHub actions * docs: updated documentation to reflect changes in behavior of the sink. Co-authored-by: Nenad Vicentic <[email protected]> * Update dotnet sdk * disable net48 tests * set api key * Remove support for Elasticsearch v2 and v5. (#488) * Remove support for Elasticsearch v2 and v5. * Code-conventions: add rule for underscore `_` on private fields (as it already is in the code). * Remove GitHub's `set-output` command deprication warning. Co-authored-by: Nenad Vicentic <[email protected]> * added path for tests * fix: Example in README is incorrect #402 (#496) * Applying right versioning * Update AssemblyInfo.cs * Remove `AssemblyInfo.cs` and move attributes to the `*.csproj` file. This enables setting assembly version via command line and CI. (#501) 1. Build and pack: dotnet build -c Release -p:Version=9.0.0-beta11 dotnet pack -c Release --no-build -p:Version=9.0.0-beta11 2. Pack (with implicit build) dotnet pack -c Release -p:Version=9.0.0-beta11 Co-authored-by: Nenad Vicentic <[email protected]> * Read Elasticsearch server version from a root page response (#502) Co-authored-by: Nenad Vicentic <[email protected]> * Versioning and permission for unit tests * [no ci] * #498 Disable `PublicSign` to fix strong-name signature verification issue of assemblies from public NuGet package: (#504) > Could not load file or assembly 'Serilog.Formatting.Elasticsearch' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)" Co-authored-by: Nenad Vicentic <[email protected]> * [no ci] --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Mikkel Nylander Bundgaard <[email protected]> Co-authored-by: mariwing <[email protected]> Co-authored-by: Marius Wingerei <[email protected]> Co-authored-by: Andrey Kozlov <[email protected]> Co-authored-by: Bo Flynn <[email protected]> Co-authored-by: Bo Flynn <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nenad Vićentić <[email protected]> Co-authored-by: Nenad Vicentic <[email protected]>
And the final v9.0.0 version: https://www.nuget.org/packages/Serilog.Sinks.Elasticsearch/9.0.0 https://github.com/serilog-contrib/serilog-sinks-elasticsearch/releases/tag/v9.0.0 Thanks for all your efforts @nenadvicentic ! |
@mivano Awesome! Really glad we did it! Thank you, as well! Without your support it would not be possible to make such a good progress! |
Does this issue relate to a new feature or an existing bug?
What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package.
9.0.0-beta8
Please describe the current behavior?
After updating .NET Framework web project from
Serilog.Sinks.Elasticsearch
version8.4.1
to verion9.0.0-beta8
compilation of project works, but on the startup assembly binding error occurs:Please describe the expected behavior?
Website should start/run without assembly-binding issues.
If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem
Update .NET Framework 4.8 project from earlier stable version of
Serilog.Sinks.Elasticsearch
(e.g.8.4.1
) to9.0.0-beta8
and run the project.The text was updated successfully, but these errors were encountered: