Open Closed

Upgrading to .net 5 #596


User avatar
0
RonaldR created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v3.2
  • UI type: MVC
  • Tiered (MVC) or Identity Server Seperated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue: *We want to move from .net core 3.1 to .net 5. what is the migration path? i tried just changing all the project to .net 5, after that failed to work, i updated nugat packes include prelease for v4-rc4, and that producted a lot of bugs in the volo soft code. how do we get to the .net 5 level in an exsting project?

11 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    See upgrade guide: https://github.com/abpframework/abp/blob/dev/docs/en/Migration-Guides/Abp-4_0.md https://github.com/abpframework/abp/blob/dev/docs/en/Migration-Guides/Abp-4_0-MVC-Razor-Pages.md

    You can also create a 4.0 preview project for comparison abp new BookStore --preview

  • User Avatar
    0
    RonaldR created

    I am still having issues. i followed the steps, most of which i tried the first time, although i didnt know about the new scope db changes, but i havehtose in place and seeded now. i am still getting the following issue when i start up the applicatiop though: System.TypeLoadException: Could not load type 'Volo.Abp.IdentityServer.ApiResources.ApiScope' from assembly 'Volo.Abp.IdentityServer.Domain, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'. at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) at System.Reflection.RuntimeMethodInfo.get_Signature() at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters() at System.Reflection.RuntimeMethodInfo.GetParameters() at Castle.DynamicProxy.Generators.MethodSignatureComparer.GetHashCode(MethodInfo obj) at System.Linq.Set1.InternalGetHashCode(TElement value) at System.Linq.Set1.Add(TElement value) at System.Linq.Set1.UnionWith(IEnumerable1 other) at System.Linq.Enumerable.DistinctIterator1.FillSet() at System.Linq.Enumerable.DistinctIterator1.ToArray() at Castle.DynamicProxy.Generators.MethodFinder.GetAllInstanceMethods(Type type, BindingFlags flags) at Castle.DynamicProxy.Contributors.MembersCollector.CollectMethods(IProxyGenerationHook hook) at Castle.DynamicProxy.Contributors.MembersCollector.CollectMembersToProxy(IProxyGenerationHook hook) at Castle.DynamicProxy.Contributors.ClassProxyTargetContributor.CollectElementsToProxyInternal(IProxyGenerationHook hook)+MoveNext() at Castle.DynamicProxy.Contributors.CompositeTypeContributor.CollectElementsToProxy(IProxyGenerationHook hook, MetaType model) at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope) at Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1_0.<GenerateCode>b__0(String n, INamingScope s) at Castle.DynamicProxy.Generators.BaseProxyGenerator.<>c__DisplayClass33_0.<ObtainProxyType>b__0(CacheKey _) at Castle.Core.Internal.SynchronizedDictionary2.GetOrAdd(TKey key, Func2 valueFactory) at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func3 factory) at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options) at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options) at Autofac.Extras.DynamicProxy.RegistrationExtensions.EnableClassInterceptors[TLimit,TConcreteReflectionActivatorData,TRegistrationStyle](IRegistrationBuilder3 registration, ProxyGenerationOptions options, Type[] additionalInterfaces) at Autofac.Extras.DynamicProxy.RegistrationExtensions.EnableClassInterceptors[TLimit,TConcreteReflectionActivatorData,TRegistrationStyle](IRegistrationBuilder3 registration) at Autofac.Builder.AbpRegistrationBuilderExtensions.AddInterceptors[TLimit,TActivatorData,TRegistrationStyle](IRegistrationBuilder3 registrationBuilder, Type serviceType, IEnumerable1 interceptors) at Autofac.Builder.AbpRegistrationBuilderExtensions.InvokeRegistrationActions[TLimit,TActivatorData,TRegistrationStyle](IRegistrationBuilder3 registrationBuilder, ServiceRegistrationActionList registrationActionList, Type serviceType, Type implementationType) at Autofac.Builder.AbpRegistrationBuilderExtensions.ConfigureAbpConventions[TLimit,TActivatorData,TRegistrationStyle](IRegistrationBuilder3 registrationBuilder, IModuleContainer moduleContainer, ServiceRegistrationActionList registrationActionList) at Autofac.Extensions.DependencyInjection.AutofacRegistration.Register(ContainerBuilder builder, IServiceCollection services) at Autofac.Extensions.DependencyInjection.AutofacRegistration.Populate(ContainerBuilder builder, IServiceCollection services) at Volo.Abp.Autofac.AbpAutofacServiceProviderFactory.CreateBuilder(IServiceCollection services) at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter1.CreateBuilder(IServiceCollection services) at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider() at Microsoft.Extensions.Hosting.HostBuilder.Build() at DAG.TFORM.Web.Program.Main(String[] args) in C:\Users\ronald.rizk\source\repos\tform_repo\DAG.TFORM\aspnet-core\src\DAG.TFORM.Web\Program.cs:line 34

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Maybe you can clear the bin & obj folders , then rebuild your project.

  • User Avatar
    0
    RonaldR created

    I just tried that but no change. it still says unable to find ApiScope.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Here are my steps:

    1. Create a new project abp new QaUpgrade -t app-pro

    2. Use Suite to upgrade the project to the pre release version.

    3. Update all microsoft* packages to 5.0.0

    4. Fix some namespace issues

    5. Remove and readd migration file.

    6. run the DbMigrator application then run .web project.

  • User Avatar
    0
    RonaldR created

    we have a 3.3.1 commericail license, it will work find with 4-rv4? can i select that from there? 4 is the right version for needing .net 5? if i need different download then what is the link to get that?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Youc can use Abp suite to upgrade the project to the pre release version.

  • User Avatar
    0
    RonaldR created

    we just moved to .net 5 and ver 4.0.0 of abp. what we found when we did this was wheni run the site it works, but if i stop it and restart it from visual studio we get a context already closed exception. after a bunch of playing around and testing i find that if i clear the cookie then i can restart it because it pushed me through the login again. so what it looks like is whe i return to the browser and a session or cookie is still alive from a previous session it fails to work, but if i delete the cookie and i am forced to authenticate then it works fine. have you seen this before?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    if i stop it and restart it from visual studio we get a context already closed exception

    Maybe related to your application, can you make a simple project to reproduce ? thanks.

  • User Avatar
    0
    RonaldR created

    we added [unitofwork] to the functionthat gets the permissions and it seemed to have respolve the problem, i just dont understand why

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    See https://docs.abp.io/en/abp/latest/Unit-Of-Work#conventions

    Maybe your method is not in conventions, so you need add [unitofwork] manually.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15