Bump new packages
NB! Breaking changes!
NuGet packages changes:
-
Microsoft.Extensions.* v3.1.32->Microsoft.Extensions.* v7.*, etc -
~~
Pomelo.EntityFrameworkCore.MySql v3.2.7->Pomelo.EntityFrameworkCore.MySql v5.0.4~~ Decided to usePomelo.EntityFrameworkCore.MySql v3.2.7as before. -
~~
Microsoft.EntityFrameworkCore. v.3.1.32->Microsoft.EntityFrameworkCore.* v.5.~~ Decided to useMicrosoft.EntityFrameworkCore. v5.0. 14. -
Lib.Harmony v2.2.2->Lib.Harmony v2.3-prerelease.3
Now OpenMod uses netstandard2.1 and netstandard2.0 only, don't use/support any more net framework
Tested with
- uScript installed (it's ok)
- uScript Plugins:
- Soon...
- Harmony (it's ok)
- RocketMod plugins:
-
UnturnedGuard(work fine) - ShimmysAdminTools (workfine)
-
- OpenMod plugins:
-
Pustalorc.PlayerInfoLib.Unturned.3.6.6(work fine) -
DiFFoZ.Kits(work fine) -
Wild.Announcer(work fine) -
New Essentials(work fine) -
OpenMod.Economy(work fine) -
UnturnedGuard(work fine)
-
Deprecated plugins
Plugins that use the provided dependencies will be deprecated:
- ~~ILogger (because ILogger moved into another package:
Microsoft.Extensions.Logging.Abstractions v7.0.1)~~ it's ok now - ServerVersion methods or options.ServerVersion
options.UseMySql(connectionString, sqlOptions =>
{
// other options configuration...
sqlOptions.ServerVersion(serverVersion); // This line should be removed now.
});
TL;DR
It's not done yet, still in the process of testing and development, sending it here to hear feedback and fix problems earlier
Yes, a lot of plugins will deprecate, but we will gonna need to proceed with a bit of work because when Unity 2022 is used in Unturned it will cause us a lot more trouble than now - better now than in the last moment.
@dotnet-policy-service agree
what about Microsoft.Extensions.* 7.*?
what about Microsoft.Extensions.* 7.*?
We can't use it while Unity on NET Framework and Netstandard, the Extensions starting with 6 and higher has target framework .NET 6/7/8 only, etc
we will be tied for a long time with netstandard2.1
what about Microsoft.Extensions.* 7.*?
We can't use it while Unity on NET Framework and Netstandard, the Extensions starting with 6 and higher has target framework .NET 6/7/8 only, etc
we will be tied for a long time with netstandard2.1
I just checked and nuget and seems like they are also netstandard2.0
what about Microsoft.Extensions.* 7.*?
We can't use it while Unity on NET Framework and Netstandard, the Extensions starting with 6 and higher has target framework .NET 6/7/8 only, etc we will be tied for a long time with netstandard2.1
I just checked and nuget and seems like they are also netstandard2.0
Pomelo.EntityFrameworkCore.MySql will be a problem then
I guess its time to remove this also
because when Unity 2022 is used in Unturned it will cause us a lot more trouble than now
Why?
what about Microsoft.Extensions.* 7.*?
We can't use it while Unity on NET Framework and Netstandard, the Extensions starting with 6 and higher has target framework .NET 6/7/8 only, etc we will be tied for a long time with netstandard2.1
I just checked and nuget and seems like they are also netstandard2.0
Pomelo.EntityFrameworkCore.MySql will be a problem then
I'm still confused why is that an issue. Is there an exception or something? Don't update Pomelo.EntityFrameworkCore.MySql but just Microsoft.Extensions.
Pustalorc.PlayerInfoLib.Unturned.3.6.6(doesn't work anymore)DiFFoZ.Kits(doesn't work anymore)Wild.Announcer(doesn't work anymore)I don't think we can just break them. Maybe there are some workarounds.
Now this branch uses Extensions v7.* and old Pomelo
Problem (the same will be in OpenMod Ef Core implementations):
[12:56:59 ERR][UnturnedGuard.OpenMod.Logging.OpenModGuardLogger] An unexpected error occured while searching for a feature types!
System.TypeLoadException: Could not load type of field 'UnturnedGuard.Services.ServicesCollectionExtensions+<>c__DisplayClass6_1:serverVersion' (0) due to: Could not resolve type with token 01000027 from typeref (expected class 'Pomelo.EntityFrameworkCore.MySql.Storage.ServerVersion' in assembly 'Pomelo.EntityFrameworkCore.MySql, Version=3.2.7.0, Culture=neutral, PublicKeyToken=2cc498582444921b') assembly:Pomelo.EntityFrameworkCore.MySql, Version=3.2.7.0, Culture=neutral, PublicKeyToken=2cc498582444921b type:Pomelo.EntityFrameworkCore.MySql.Storage.ServerVersion member:(null)
at (wrapper managed-to-native) System.RuntimeTypeHandle.type_is_assignable_from(System.Type,System.Type)
at System.RuntimeTypeHandle.CanCastTo (System.RuntimeType type, System.RuntimeType target) [0x00000] in <47fc8c70fa834cbf8141d7c1a7589125>:0
at System.RuntimeType.IsAssignableFrom (System.Type c) [0x00020] in <47fc8c70fa834cbf8141d7c1a7589125>:0
at UnturnedGuard.Services.ServicesCollectionExtensions+<>c.<RegisterFeatures>b__1_0 (System.Type t) [0x00000] in <8a4886ce9e5d4379b6cf9f641dc1eb5a>:0
at System.Linq.Enumerable+WhereArrayIterator`1[TSource].MoveNext () [0x0002c] in <d61464951b0243f18092630834a7bf18>:0
at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00059] in <47fc8c70fa834cbf8141d7c1a7589125>:0
at System.Collections.Generic.List`1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable`1[T] collection) [0x000f4] in <47fc8c70fa834cbf8141d7c1a7589125>:0
at System.Collections.Generic.List`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] collection) [0x00000] in <47fc8c70fa834cbf8141d7c1a7589125>:0
at UnturnedGuard.Services.ServicesCollectionExtensions.RegisterFeatures (Microsoft.Extensions.DependencyInjection.IServiceCollection source, UnturnedGuard.Guard.Logging.IGuardLogger logger, UnturnedGuard.Shared.Models.UnturnedGuardSettings settings) [0x0004e] in <8a4886ce9e5d4379b6cf9f641dc1eb5a>:0
2 Solutions:
- Use v5.* of the Pomelo
- Don't use options.ServerVersion() (this one is being used right now as a solution)
As I said before to avoid misunderstanding by other devs using Microsoft.* and Pomelo API it is better to use Pomelo and Ef Core with v5.*
Currently blocking to make decision about updating Harmony to the Harmony v2.3-prerelease.2, because v2.2.2 causes compile issue with transpiler patch (Label reference mismatch, see image).
Currently blocking to make decision about updating Harmony to the Harmony v2.3-prerelease.2, because v2.2.2 causes compile issue with transpiler patch (
Labelreference mismatch, see image).
Perhaps it is more a VS problem, I use JetBrains Rider, and it is okay for me, but anyway, I changed the version to the latest Harmony prerelease v3, updated runtime libs, and fixed other issues
Fixed branch conflicts
There are new conflicts
Fixed conflicts
Fixed conflicts
Fixed conflicts
Unless there are objections, this will probably be merged with OpenMod 3.8
Before releasing the new version, we should ping devs about the EF Core error that currently is forced to silent, see commit https://github.com/openmod/openmod/pull/772/commits/6e73e4d7bcb155c0e23784cdc90a1251a656256f
Given the huge amount of conflicts and age, I redid the PR and merged manually. Thanks for your contributions.
