Fody/Costura

Visual Studio 2022 WPF DesignViewer

langeth opened this issue · 12 comments

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • [X ] WPF
  • UWP
  • iOS
  • Android
  • .NET Standard
  • .NET Core

Fody Costura

What component is this issue occurring in?

6.5.5

Version of OS(s) listed above with issue

Windows 10

Steps to Reproduce

  1. Open WPF Xaml Project with VS 2022 with MahApps or Fluent Ribbon
  2. Install Nuget Fody/Costura
  3. Reopen VS 2022 and Open Designviewer Mainwindow.xaml

Expected Behavior

XDG0062 File or Assembly not found "Mahapps.Metro....."

Actual Behavior

Deinstall Fody/Costura

This problem I got with VB.NET Project and C# Project.

@langeth That's a bug with the XAML designer, I also experience this from time to time, with or without Costura.

This is only related to the designer window, it always builds and runs fine, even intellisense works in the designer.

I saw this last in the main window of one project, but not in any user control.

After reloading the solution, it was gone. After rebuild it was there again.

However there is nothing Costura can do about it. Maybe you can try limiting Costura to be active only in the release build.

Hi Tom,
thanks for the response. How can I managed Costura only active at release build?

Thanks,
Thomas

Just put a condition on the <PackageReference> in the project file.
You may also want to move your configuration to the project file to avoid warnings when Costura is off: Configuring Weavers

It dosen't work in combination with MahApps. I got the same XDG0062 error, also at Debug - mode.

Did you check that the binaries are all there in the bin folder?
I had to close VS and delete all bin and obj folders before the changes where effective.

That I do, but the error remaind. I had only add this condition at Projectfile:

Reference Include="Costura, Version=5.7.0.0, Culture=neutral, processorArchitecture=MSIL" Condition="'$(Configuration)' == 'Release'"

Deleted bin and obj Folder and start VS. XDG0062 will come for MahApps.Metro and MahApps.Metro.IconPacks.Material

The condition must be at the <PackageReference> of Costura.Fody!
Why do you reference Costura.dll? Do you use the legacy packages.config instead of <PackageReference>?

Yes, I use packages.config.

That's not supported

I changed to PackageReference. Same problem with:
PackageReference Include="Costura.Fody" Condition="'$(Configuration)' == 'Release'"

I also must delete the fodyweaver.xml and then it will work at Debug Configuration.