Reputation: 3
I built an installer for a .Net application that contains MahApps.Metro dll for WPF forms. I added the MahApps.Metro DLL to the resource folder and referenced it from there in the project. The installer for this application was created using WiX Toolset.
I get this error in the log file. 'Could not load file or assembly 'MahApps.Metro, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.'
However, the installer works on some machines but not on others. How can I resolve this issue?
Troubleshooting I have done:
1. Verified that both working and non-working machines have the same .NET Framework version (4.8).
2. Copied the same DLL from a working machine to a non-working machine to see if it resolves the issue.
3. Checked the versions of MahApps.Metro.dll and ControlEx.dll on both working and non-working machines.
4. Verified that the installer directory on the non-working machine contains MahApps.Metro.dll, ControlEx.dll, and System.Windows.Interactivity.dll.
Here is the Fusion enabled Log
Timestamp:
2024-08-29 11:19:01
Message:
Could not load file or assembly 'MahApps.Metro, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Source:
PresentationFramework
InnerException:
System.IO.FileNotFoundException: Could not load file or assembly 'MahApps.Metro, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'MahApps.Metro, PublicKeyToken=null'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly bamlAssembly)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType bamlType)
at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
at System.Windows.Baml2006.Baml2006SchemaContext.GetProperty(Int16 propertyId, XamlType parentType)
at System.Windows.Baml2006.Baml2006Reader.Process_PropertyWithConverter()
at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
at System.Windows.Baml2006.Baml2006Reader.Process_BamlRecords()
at System.Windows.Baml2006.Baml2006Reader.Read()
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Program Files\***/***\**.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = MahApps.Metro, PublicKeyToken=null
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: MahApps.Metro, PublicKeyToken=null | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files/***/***/
LOG: Initial PrivatePath = NULL
Calling assembly : PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files/***/***/MahApps.Metro.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/***/***/MahApps.Metro/MahApps.Metro.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/***/***/MahApps.Metro.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/***/***/MahApps.Metro/MahApps.Metro.EXE.
Upvotes: 0
Views: 76