Jumoo / uSync.CommandLine

Remote command line tools for Umbraco
5 stars 5 forks source link

Support for Umbraco 13? #8

Closed cvocvo closed 6 months ago

cvocvo commented 9 months ago

Hello, is there any way to get support for Umbraco 13?

When I try to launch my v13 (upgrade from v10) project, I an error at this point in Startup.cs

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddUmbraco(_env, _config)
                .AddBackOffice()
                .AddWebsite()
                .AddComposers()
                .Build();

And the error is:

System.Reflection.ReflectionTypeLoadException
  HResult=0x80131602
  Message=Could not load all types from "uSync.Commands, Version=10.0.4.0, Culture=neutral, PublicKeyToken=null" due to LoaderExceptions, skipping:
. System.TypeLoadException on uSync.BackOffice.Controllers.SyncActionResult: Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on uSync.BackOffice.Controllers.SyncActionResult: Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on uSync.BackOffice.Controllers.SyncActionResult: Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on uSync.BackOffice.Controllers.SyncActionResult: Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.

Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'uSync.BackOffice.Controllers.SyncActionResult' from assembly 'uSync.BackOffice, Version=13.1.0.0, Culture=neutral, PublicKeyToken=null'.
  Source=Umbraco.Core
  StackTrace:
   at Umbraco.Cms.Core.Composing.TypeFinder.GetTypesWithFormattedException(Assembly a)
   at Umbraco.Cms.Core.Composing.TypeFinder.GetClassesWithBaseType(Type baseType, IEnumerable`1 assemblies, Boolean onlyConcreteClasses, Func`2 additionalFilter)
   at Umbraco.Cms.Core.Composing.TypeFinder.FindClassesOfType(Type assignTypeFrom, IEnumerable`1 assemblies, Boolean onlyConcreteClasses)
   at Umbraco.Extensions.TypeFinderExtensions.FindClassesOfType[T](ITypeFinder typeFinder, IEnumerable`1 assemblies, Boolean onlyConcreteClasses)
   at Umbraco.Cms.Core.Composing.TypeLoader.<>c__DisplayClass21_0`1.<GetTypes>b__0()
   at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternalLocked(Type baseType, Type attributeType, Func`1 finder, String action, Boolean cache)
   at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternal(Type baseType, Type attributeType, Func`1 finder, String action, Boolean cache)
   at Umbraco.Cms.Core.Composing.TypeLoader.GetTypes[T](Boolean cache, IEnumerable`1 specificAssemblies)
   at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilderExtensions.AddAllCoreCollectionBuilders(IUmbracoBuilder builder)
   at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder.AddCoreServices()
   at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder..ctor(IServiceCollection services, IConfiguration config, TypeLoader typeLoader, ILoggerFactory loggerFactory, IProfiler profiler, AppCaches appCaches, IHostingEnvironment hostingEnvironment)
   at Umbraco.Extensions.UmbracoBuilderExtensions.AddUmbraco(IServiceCollection services, IWebHostEnvironment webHostEnvironment, IConfiguration config)
   at UmbracoProject.Startup.ConfigureServices(IServiceCollection services) in C:\Users\{redacted}\Documents\Git\UmbracoProject\UmbracoProject\Startup.cs:line 44
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass7_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
   at Microsoft.Extensions.Hosting.HostBuilder.InitializeServiceProvider()
   at Microsoft.Extensions.Hosting.HostBuilder.Build()
   at Umbraco.Cms.Web.Common.Hosting.UmbracoHostBuilderDecorator.Build()
   at UmbracoProject.Program.Main(String[] args) in C:\Users\{redacted}\Documents\Git\UmbracoProject\UmbracoProject\Program.cs:line 6
cvocvo commented 9 months ago

Sort of an odd development, but I was wondering why we didn't catch this sooner during our v10 to v13 upgrade. I undid my changes and reverted to what's on the remote branch. In doing so I went downgraded from uSync 13.1.0 to uSync 13.0.1; thus in between these versions, there appears to be a breaking change for the existing uSync.Commands 10.0.4. My workaround for now is to stay on the older 13.0.1 version of uSync packages.

KevinJump commented 9 months ago

Yeah - we moved the models that the controllers use to a diffrent location - i thought we have coverd the changes, but not in command line it turns out 😞

KevinJump commented 9 months ago

Nightly build working on v13

https://dev.azure.com/jumoo/Public/_artifacts/feed/nightly/NuGet/uSync.Cli/overview/13.0.0-build.20240216.2

Shouldn't be an issue if you want to use this version .

We will check and push it out live next week.

cvocvo commented 9 months ago

Thank you!, we'll hang tight and wait for the updated version

cvocvo commented 8 months ago

If that nightly worked, could you push out the updated version?

jrunestone commented 8 months ago

@KevinJump Hi Kevin this is a show stopper for us trying to upgrade to Umb13 and the latest usync packages, since it's an integral part of our cicd pipeline :)

I'd appreciate an updated live version as soon as you're able

jrunestone commented 7 months ago

@KevinJump Can you please give an update here?

KevinJump commented 7 months ago

Sorry for the stupid delay.

v13.1 is out (its because it works against uSync v13.1 and above)

https://www.nuget.org/packages/uSync.Commands/13.1.0

there is still an issue if you want to also use uSync.Roots functionality (the commands are really only setup to to deal with a single uSync folder and uSync can now merge many folders into one on import, export etc)

but if you are not doing that then everything works as expected

jrunestone commented 7 months ago

@KevinJump No worries, thanks!

cvocvo commented 6 months ago

@KevinJump -- We finally did upgrade to the latest version of Umbraco 13.3.1 and in doing so also upgraded to uSync.Commands v13.1.0 and uSync 13.2.2. However, I'm running into a weird problem I don't understand.

These two commands work:

usync run info -s https://www.example.com/umbraco -user user@example.com -pass "example~!"
usync run test -s https://www.example.com/umbraco -user user@example.com -pass "example~!"

But this command doesn't work: usync run uSync-Import -s https://www.example.com/umbraco -user user@example.com -pass "example~!"

Instead, it gives me an error: image

Any ideas?

Edit: If I manually import I get this error: image

Edit2: If we do a clean export per the health checker settings, the issue is fixed and no more 404: image