Developer forum

Forum » Dynamicweb 10 » Exception in local app installed through appstore

Exception in local app installed through appstore

Jóhannes Þorkell Tómasson
Reply

I'm getting an exception when interacting with an installed local app addin:

      An unhandled exception has occurred while executing the request.
      System.ArgumentException: Value cannot be null or an empty string. (Parameter 'value')
         at NuGet.Versioning.NuGetVersion.Parse(String value)
         at Dynamicweb.Marketplace.MarketplaceService.<>c__DisplayClass7_0.<GetDependency>b__0(AddinProvider m)
         at Dynamicweb.Marketplace.MarketplaceService.Sync[T](Func`2 func, String manager)
         at Dynamicweb.Marketplace.MarketplaceService.GetDependency(String package, String manager, String version)
         at Dynamicweb.Marketplace.MarketplaceService.GetDependencies(String package, String provider, String version)
         at Dynamicweb.Content.UI.Queries.AddinDependenciesQuery.GetModel()
         at Dynamicweb.CoreUI.Screens.ScreenBuilders.ListScreenBuilder`3.GetScreenModel(DataQueryModelBase`1 query)
         at Dynamicweb.CoreUI.Screens.ScreenBuilders.ListScreenBuilder`3.Make()
         at Dynamicweb.CoreUI.Screens.ScreenBuilder.MakeScreen(BuildRequest request)
         at Dynamicweb.Management.UI.Controllers.AdminController.GetScreenFromDefinition(String screenDefinition, String shadowEditId)
         at Dynamicweb.Management.UI.Controllers.AdminController.GetLayoutDefinition(String screenDefinition, String shadowEditId)
         at Dynamicweb.Management.UI.Controllers.AdminController.GetScreen(String layout, String navigationPath, String shadowEditId)
         at Dynamicweb.Management.UI.Controllers.AdminController.GetUI()
         at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
         at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
         at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
         at Dynamicweb.Management.UI.Middleware.AdminUIRedirectMiddleware.Invoke(HttpContext context)
         at Dynamicweb.Management.UI.Middleware.AdminDiagnosticsMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

It happens when I select the app from "Installed apps" in Appstore admin UI. I had no problems installing the app. It's complaining about NugetVersion so there is my csproj file:

<Project Sdk="Microsoft.NET.Sdk">
 
  <PropertyGroup>
    <Version>10.0.52</Version>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <Title>Advania Prufa</Title>
    <Description>Advania Test</Description>
  </PropertyGroup>
  <PropertyGroup>
    <PackageProjectUrl>https://advania.is</PackageProjectUrl>
    <PackageTags>integration</PackageTags>
    <Product>Test</Product>
    <Company>Advania</Company>
    <Authors>Jói</Authors>
    <Copyright>Copyright © 2023 Advania</Copyright>
  </PropertyGroup>
  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <IncludeSymbols>true</IncludeSymbols>
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
    <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Dynamicweb" Version="10.0.26" />
    <PackageReference Include="Dynamicweb.Core" Version="10.0.26" />
  </ItemGroup>
 
</Project>

I tried some different stuff but ended up copying the csproj from you OdataProvider on github and adjusting to my test app and building out a nupkg that I put in the Files/System/Addins/Local directory.

 


Replies

 
Frederik Nielsen Dynamicweb Employee
Frederik Nielsen
Reply

Hi Jóhannes!

I can't seem to reproduce this exception locally with any packages I create and put into the /Locals folder, is it possible for you to provide some slimmed version of your .nupkg that I can try with?

Regardless, I seem to have found the place the error occurs, I just don't understand how we get there with this case. I will propose a fix for this for our next version to avoid it in the future, but it would be good to have a package I can actually reproduce and confirm a fix with!

 
Jóhannes Þorkell Tómasson
Reply

Hi Frederik.

I included a slimmed copy of my Files > System > Addins folder archived in the attachments. It only includes the nupkg file under "Local" and the corresponding installed dll in the "Installed" folder. The functionality of the addin is very light weight, only a nonsensical notification subscriber for testing purposes (I was trying to install a checkouthandler app but that didn't work so I switched to the most lightweight addin I could think of for debugging purposes).

I'm only getting this exception for local apps. The apps I've installed through the store made by you guys work fine.

 

You must be logged in to post in the forum