Skip to content

Unable to deploy lables/Resource DLL specific to different language during on prem CSU package and Store commerce package install #270

@shuelsmeier

Description

@shuelsmeier

Hello @lukedgr, @madyke: I have updated the project file of my OnPrem Scale Unit Installer with the following snippet:

<Target Name="LinkResourceFilesInPackage" BeforeTargets="RetailInstallerFrameworkCopyFilesToIntermediateOutputPath" DependsOnTargets="PrepareProjectReferences;ValidateProjectConfiguration;Compile;">
  <ItemGroup>
    <_ResourceFileAssemblies Include="..\CommerceRuntime\bin\$(Configuration)\net6.0\**\Contoso.EFRSample.CommerceRuntime.resources.dll" />
  </ItemGroup>
  <ItemGroup>
    <ZipFiles Include="@(_ResourceFileAssemblies->'%(FullPath)')">
      <Link>%(_ResourceFileAssemblies.RecursiveDir)%(_ResourceFileAssemblies.Filename)%(_ResourceFileAssemblies.Extension)</Link>
    </ZipFiles>
  </ItemGroup>
</Target>

Running the installer results in the same error as in #174 (comment). Somehow the binding redirects are missing.

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.IO.Abstractions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=96bf224d23c43e59' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
  at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
  at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
  at System.Reflection.RuntimeMethodInfo.GetParameters()
  at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat)
  at System.Exception.GetStackTrace(Boolean needFileInfo)
  at System.IO.FileLoadException.ToString()
  at Microsoft.Dynamics.Commerce.Installers.Framework.Program.Main() in C:\Users\shuelsmeier\.nuget\packages\microsoft.dynamics.commerce.sdk.installers.scaleunit\9.47.24058.3\contentFiles\cs\netstandard2.0\Program.cs:line 44
The command "powershell.exe -NonInteractive -Command "& { C:\xxxxxxxxxxx\Contoso.ScaleUnit.OnPrem.Installer\bin\Debug\net472\Contoso.ScaleUnit.OnPrem.Installer.exe install --skipversioncheck=true }"" exited with code -1.

Adding the original binding redirects does not help

12:48:05 [Fatal] RegisterLoggerFailed Registration failed for the following sinks: Microsoft.Dynamics.Retail.Diagnostics.ApplicationInsights, Microsoft.Dynamics.Retail.Diagnostics.ApplicationInsights.ApplicationInsightsLogger.
System.AggregateException: Registration failed for the following sinks: Microsoft.Dynamics.Retail.Diagnostics.ApplicationInsights, Microsoft.Dynamics.Retail.Diagnostics.ApplicationInsights.ApplicationInsightsLogger ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeAssembly.get_DefinedTypes()
   at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at Microsoft.Dynamics.Retail.Diagnostics.Composition.LoadTypes[T](IDiagnosticsCompositionConfigElement compositionConfigElement)
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.RegisterLogger(ILoggingBuilder builder, IDiagnosticsSinkConfigElement sinkConfig, IDiagnosticsFilterConfigElement sinkConfigFilter)
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.LoadSinks(IDiagnosticsConfig diagnosticsConfig)
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeAssembly.get_DefinedTypes()
   at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at Microsoft.Dynamics.Retail.Diagnostics.Composition.LoadTypes[T](IDiagnosticsCompositionConfigElement compositionConfigElement)
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.RegisterLogger(ILoggingBuilder builder, IDiagnosticsSinkConfigElement sinkConfig, IDiagnosticsFilterConfigElement sinkConfigFilter)
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.LoadSinks(IDiagnosticsConfig diagnosticsConfig)<---Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigurationException: Could not load the diagnostics config. ---> System.AggregateException: Registration failed for the following sinks: Microsoft.Dynamics.Retail.Diagnostics.ApplicationInsights, Microsoft.Dynamics.Retail.Diagnostics.ApplicationInsights.ApplicationInsightsLogger ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeAssembly.get_DefinedTypes()
   at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at Microsoft.Dynamics.Retail.Diagnostics.Composition.LoadTypes[T](IDiagnosticsCompositionConfigElement compositionConfigElement)
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.RegisterLogger(ILoggingBuilder builder, IDiagnosticsSinkConfigElement sinkConfig, IDiagnosticsFilterConfigElement sinkConfigFilter)
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.LoadSinks(IDiagnosticsConfig diagnosticsConfig)
   --- End of inner exception stack trace ---
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.LoadSinks(IDiagnosticsConfig diagnosticsConfig)
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.Initialize(IDiagnosticsConfig diagnosticsConfig)
   --- End of inner exception stack trace ---
   at Microsoft.Dynamics.Retail.Diagnostics.DiagnosticsConfigManager.Initialize(IDiagnosticsConfig diagnosticsConfig)
   at Microsoft.Dynamics.Commerce.Installers.Framework.InstallerFramework.ConfigureLogging(IServiceCollection serviceCollection, IFileSystem fileSystem, LogLevel logLevel, String logDirectory, String installerName, String instrumentationKey, String extensionName, String& logSubdirectory)
   at Microsoft.Dynamics.Commerce.Installers.Framework.InstallerFramework.<Run>d__12.MoveNext()
12:48:05 [Information] LogsSavedToDirectory Logs were saved to 'C:\ProgramData\Microsoft Dynamics 365\10.0\logs\Commerce Scale Unit_UP.Dynamics365Commerce.ScaleUnit.OnPrem.Installer_20240227114804'
12:48:05 [Information] NeedHelpMessage If you need help, contact your system administrator and provide this operation ID: 5fe297a8603f6041b644b9892a7e1522

Also the snipped in comment #174 (comment) for the Store Commerce Installer does not work. The file size of the installer is reduced and when executing it no installation is performed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions