Hi,
I've added the Extended WPF Toolkit using nuget.org and added a Zoombox to a window. When running the application the Zoombox will throw an exception.
The inner exception message is "Illegal characters in path" and stack trace:
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetFileName(String path)
at System.IO.Path.GetFileNameWithoutExtension(String path)
at Xceed.Wpf.Toolkit.Core.Utilities.ResourceHelper.LoadResourceStream(Assembly assembly, String resId)
at Xceed.Wpf.Toolkit.Zoombox.ZoomboxCursors..cctor()
When trying to troubleshoot this issue I made a copy of ResourceHelper and called it using the toolkit assembly and found out that it use the assembly's ManifestModule to build a resource name:
internal static Stream LoadResourceStream(Assembly assembly, string resId)
{
string basename = System.IO.Path.GetFileNameWithoutExtension(assembly.ManifestModule.Name) + ".g";
ResourceManager resourceManager = new ResourceManager(basename, assembly);
// resource names are lower case and contain only forward slashes
resId = resId.ToLower();
resId = resId.Replace('\\', '/');
return (resourceManager.GetObject(resId) as Stream);
}
The problem seems to be that the Name of the ManifestModule is "<Unknown>" which is the cause of the exception.
Comments: ** Comment from web user: mgnslndh **
I've added the Extended WPF Toolkit using nuget.org and added a Zoombox to a window. When running the application the Zoombox will throw an exception.
The inner exception message is "Illegal characters in path" and stack trace:
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetFileName(String path)
at System.IO.Path.GetFileNameWithoutExtension(String path)
at Xceed.Wpf.Toolkit.Core.Utilities.ResourceHelper.LoadResourceStream(Assembly assembly, String resId)
at Xceed.Wpf.Toolkit.Zoombox.ZoomboxCursors..cctor()
When trying to troubleshoot this issue I made a copy of ResourceHelper and called it using the toolkit assembly and found out that it use the assembly's ManifestModule to build a resource name:
internal static Stream LoadResourceStream(Assembly assembly, string resId)
{
string basename = System.IO.Path.GetFileNameWithoutExtension(assembly.ManifestModule.Name) + ".g";
ResourceManager resourceManager = new ResourceManager(basename, assembly);
// resource names are lower case and contain only forward slashes
resId = resId.ToLower();
resId = resId.Replace('\\', '/');
return (resourceManager.GetObject(resId) as Stream);
}
The problem seems to be that the Name of the ManifestModule is "<Unknown>" which is the cause of the exception.
Comments: ** Comment from web user: mgnslndh **
Hi,
I have debugged the issue further and it boils down to me using [Fody.Costura](https://github.com/Fody/Costura) which merges all referenced assemblies into a single executable. I guess Costura creates a new `ManifestModule` with the name "<Unknown>".
My workaround is to exclude the toolkit from being merged. I would however like to be able to merge the toolkit into my single executable. This could be supported by using `assembly.GetName().Name` instead of `assembly.ManifestModule.Name`
What do you think?