microsoft / microsoft/Dynamics365Commerce.Solutions
Unable to deploy lables/Resource DLL specific to different language during on prem CSU package and Store commerce package install
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 80
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
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 https://github.com/microsoft/Dynamics365Commerce.Solutions/issues/174#issuecomment-1787709273. 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 https://github.com/microsoft/Dynamics365Commerce.Solutions/issues/174#issuecomment-1777954385 for the Store Commerce Installer does not work. The file size of the installer is reduced and when executing it no installation is performed.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the OnPrem Scale Unit Installer project file and its LinkResourceFilesInPackage target, then run the reported installer command while inspecting the generated package contents and binding redirects. Compare the approach with the referenced issue 174 comments. Done means the language-specific resource DLL is included and both the on-premises and Store Commerce installers complete without assembly-load errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- build-system, devops, release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100