Closed dknippel closed 1 year ago
Hi @punker76 , is there anyway you could provide some help with this?
It appears to have several dependencies such as .NET Core 3.1, .NET 4.5, etc. However, I only need it for .NET 4.7.2. My IDE is VS2022, and my OS is Windows 11 Pro
Generally, the NuGet Manager seems to install dependencies correctly but I still seem to be missing something? Am I missing something? Again, what's weird is the IconPacks seems to work fine in design mode, but not runtime.
I've also tried to build from source via https://github.com/MahApps/MahApps.Metro.IconPacks/releases/tag/4.11.0 but that is another nightmare that appears to have even more dependencies. Any advice you could provide would be great! :-)
OK, I've been able to modify the https://github.com/MahApps/MahApps.Metro.IconPacks/releases/tag/4.11.0 solution so that it only builds:
Interestingly enough, to get it to build successfully, one has to edit the global.json file to specify the latest SDK available on their dev box. Is this by design, and if it is, why are there zero support docs to explain any of this?
Regardless, after replacing the references added by NuGet with the above https://github.com/MahApps/MahApps.Metro.IconPacks/releases/tag/4.11.0 assemblies .... still no joy at runtime -->
Could not load file or assembly 'MahApps.Metro.IconPacks.Modern, PublicKeyToken=0c0d510f9915137a' or one of its dependencies. The system cannot find the file specified.
Any thoughts? I'm open to enlightenment... :-|
OK, I discovered why none of the MahApps.Metro.IconPacks resources were being found at runtime. Because they weren't being copied to the output directory at build time and yes, I had the compile option of Copy Local
set to True
. Strange though...
Any ideas on why the IconPacks assembly reference is not getting copied?
@dknippel This sounds all very strange, because I never seen such errors.
@dknippel And it's not necessary to add any resource at App.xaml from IconPacks, except you want to override some styles.
@dknippel Here is my short/simple sample created with the latest VS 2022 update.
Hi @punker76 , thanks for your reply. Yes, your WpfAppIconPacks2.zip sample works fine. It is a bit different setup than mine. Regardless, I am having to use the workaround described in UPDATE - PART DEUX above. Still strange why none of the MahApps.Metro.IconPacks assembly references get copied to the output directly. Oh well :-|
@dknippel If it’s possible then send me your app, cause I’m interested in the different setup.
I'm not sure if I can legally send you the app (government medical imaging technology). However, it basically goes like this:
All .NET 4.7.2 components...
Host (console app)
MVVM
approach existStartupUrl
in the Appl.xaml
App
object and then calls InitializeComponent()
which in turn loads in said App.xaml
So, life begins something like this:
Obviously the DRACO GUI contains a reference to (via NuGet Manager):
And as one would expect in the Host output directory:
However, what is not expected:
Hi @dknippel have you solved this issue?
Kind of I guess. I mean, the workaround is:
I have to explicitly add (via NuGet Manager) the MahApps.Metro.IconPacks package to Host
I've installed 4.11.0 via the NuGet Package Manager within VS2022. However, when I run my app, it fails on
InitializeComponent()
and states:At design time, the XAML designer appears to be able to find the resource like so: (see first screen scrape)
But when I run the app, it doesn't seem to find it like so: (see second screen scrape)
Do I need to explicitly add a
ResourceDictionary
to my App.xaml perhaps like so:When I try to add said
ResourceDictionary
it complains with:Everything worked great with the MahApps.Metro stuff, but not so much with the IconPacks stuff. What am I missing?