Closed mytechmicke closed 3 months ago
Hello Mikael
Can you give me more information about the .net version used in your application?
Hi, 4.7.2
I have test it with a fresh 4.7.2 project without issues.
Can you try this to your app.config
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.5.5" newVersion="4.5.5" />
</dependentAssembly>
</assemblyBinding>
https://github.com/confluentinc/confluent-kafka-dotnet/issues/1507#issuecomment-961521387
Hi, Now the file looks like this:
<?xml version="1.0" encoding="utf-8"?>
Is this correct? This did not work, same error. Best regards, Mikael
From: Tino Hager @.> Sent: Tuesday, 26 March 2024 20:49 To: nager/Nager.Date @.> Cc: Mikael Lindner @.>; Author @.> Subject: Re: [nager/Nager.Date] Using HolidaySystem creates error -> Could not load file or assembly System.Memory, Version=4.0.1.2 (Issue #626)
I have test it with a fresh 4.7.2 project without issues.
Can you try this to your app.config
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.5.5" newVersion="4.5.5" />
</dependentAssembly>
</assemblyBinding>
confluentinc/confluent-kafka-dotnet#1507 (comment)https://github.com/confluentinc/confluent-kafka-dotnet/issues/1507#issuecomment-961521387
— Reply to this email directly, view it on GitHubhttps://github.com/nager/Nager.Date/issues/626#issuecomment-2021334707, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHWDOKLMEI4YRGCRT7RS6JLY2G7JFAVCNFSM6AAAAABFJRWL7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRRGMZTINZQG4. You are receiving this because you authored the thread.Message ID: @.**@.>>
Can you validate this in your project file? (.csproj)
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
....
</PropertyGroup>
Hi, Same error. I will try on another machine/project.
Hi, Exactly same error on a different machine and another project.
Do you have the same error with a clean new .net 4.7.2 project?
Hi, I made a new WinForm project and there it works. My other projects are of type Class Library. It does not work in any of them. Can you see any differences between project types that might affect the functions and create this error?
I could imagine that there is another dependency in the other project that includes an old version of System.Text.Json and that causes a conflict.
Hi, The only json part in my projects is: Newtonsoft.json >= 12.0.1 Can this be a problem?
Hi, I have done a chart over which dll's are used, enclosed pdf file. The one called Mobigo is the software that I'm extending and the columns shows which dll's are used and what version. In Nager column I have the versions from install, see enclosed image. Do you see any problems with the different versions? Nager-Mobigo-files-versions.pdf
Hi, I tried to overwrite all common DLL's (used all from Nager) and got a different error:
at System.ReadOnlySpan`1..ctor(T[] array) at Nager.LicenseSystem.LicenseKeyValidator.Validate(String licenseKey, LicenseInfo& licenseInfo) at Nager.Date.Helpers.LicenseHelper.CheckLicenseKey(String licenseKey) at Nager.Date.HolidaySystem.CheckLicense(String licenseKey) at Nager.Date.HolidaySystem.TryGetHolidayProvider(CountryCode countryCode, IHolidayProvider& holidayProvider) at Nager.Date.HolidaySystem.IsHoliday(DateTime date, CountryCode countryCode, HolidayTypes holidayTypes, Holiday[]& publicHolidays) at BookingSentinel.CalendarHelper.IsDayHoliday(DateTime day) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\CalendarHelper.cs:line 87 at BookingSentinel.CalendarHelper.IsDayWorkDay(DateTime day) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\CalendarHelper.cs:line 64 at BookingSentinel.CalendarHelper.AdjustStopDateForHolidaysAndWeekends(DateTime start, DateTime stop) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\CalendarHelper.cs:line 542 at BookingSentinel.BookingSentinel.OnSaving(IBooking item) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\BookingSentinel.cs:line 158
Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Hi, The only json part in my projects is: Newtonsoft.json >= 12.0.1 Can this be a problem?
it may also be another package which in turn has a dependency on system.text.json.
Hi, I made a new WinForm project and there it works. My other projects are of type Class Library. It does not work in any of them. Can you see any differences between project types that might affect the functions and create this error?
This Setup work on my test, Class1.cs
contains the Nager.Date logic
Hi, I have done a chart over which dll's are used, enclosed pdf file. The one called Mobigo is the software that I'm extending and the columns shows which dll's are used and what version. In Nager column I have the versions from install, see enclosed image. Do you see any problems with the different versions? Nager-Mobigo-files-versions.pdf
The versions in the pdf make no sense, these versions do not exist according to nuget.org
Hi, I just took file version in properties of each dll. Perhaps that was wrong, I don't know how else get the version.
how can i reach you best do you want to send me an e-mail?
Hi, mikael@mytech.se
Hi, can you try with the new version of Nager.LicenseSystem
1.1.0
Hi, just sent you an email.
The new package now has legacy json support without dependencies. Please also use the updated license key in the sponsor dashboard.
NuGet Package Version
2.2.2
More information
Hi, Stack trace in my project:
at Nager.LicenseSystem.LicenseKeyValidator.Validate(String licenseKey, LicenseInfo& licenseInfo) at Nager.Date.Helpers.LicenseHelper.CheckLicenseKey(String licenseKey) at Nager.Date.HolidaySystem.CheckLicense(String licenseKey) at Nager.Date.HolidaySystem.TryGetHolidayProvider(CountryCode countryCode, IHolidayProvider& holidayProvider) at Nager.Date.HolidaySystem.IsHoliday(DateTime date, CountryCode countryCode, HolidayTypes holidayTypes, Holiday[]& publicHolidays) at BookingSentinel.CalendarHelper.IsDayHoliday(DateTime day) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\CalendarHelper.cs:line 85 at BookingSentinel.CalendarHelper.IsDayWorkDay(DateTime day) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\CalendarHelper.cs:line 64 at BookingSentinel.CalendarHelper.AdjustStopDateForHolidaysAndWeekends(DateTime start, DateTime stop) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\CalendarHelper.cs:line 538 at BookingSentinel.BookingSentinel.OnSaving(IBooking item) in C:\Users\Micke\Documents\Visual Studio 2022\Projects\BookingFactory\BookingFactory\BookingSentinel\BookingSentinel.cs:line 158
and also:
{"Could not load file or assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"}
This occurs when using HolidaySystem. I have set license key both in function and in creation of class. What is wrong here? Best regards, Mikael