I'm trying to fix some problems in the PanDocMarkdownParserAddin. I have forked the project, but when I compile it in Visual Studio 2017 I get this error
Severity Code Description Project File Line Suppression State Error The tag 'MetroWindow' does not exist in XML namespace 'http://metro.mahapps.com/winfx/xaml/controls'. Line 1 Position 24. PanDocMarkdownParserAddin C:\Users\Anders\Documents\GitHub\gmagana\Pandoc-MarkdownMonster-Addin\PanDocMarkdownParserAddin\PandocWindow.xaml 1
The reference for MahApps.Metro is in C:\Users\Anders\AppData\Local\Markdown Monster\MahApps.Metro.dll
If I use NuGet and add the MahApps.Metro package, then everything works. But I assume thats not a good idea since probably end up with MahApps.Metro.dll on multiple places.
Any idea on why this happens and how to fix it?
// Anders
Windows 10 1909 Visual Studio 2017
Hi Anders,
You should reference those missing assemblies in the Markdown Monster install folder and then mark them as Do not copy.
In the project file this looks like this:
<ItemGroup>
<Reference Include="FontAwesome.WPF">
<HintPath>$(LocalAppData)\Markdown Monster\FontAwesome.WPF.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MahApps.Metro">
<HintPath>$(LocalAppData)\Markdown Monster\MahApps.Metro.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>$(LocalAppData)\Markdown Monster\NewtonSoft.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Westwind.Utilities">
<HintPath>$(LocalAppData)\Markdown Monster\Westwind.Utilities.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MarkdownMonster">
<HintPath>$(LocalAppData)\Markdown Monster\MarkdownMonster.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xaml" />
<Reference Include="PresentationFramework" />
<Reference Include="PresentationCore" />
<Reference Include="WindowsBase" />
</ItemGroup>
My guess it doesn't work for you because you don't have MM installed in the default location (%localappdata%\Markdown Monster
) so it's not finding those dependencies.
+++ Rick ---
Hello Rick,
I compared the xaml you showed in the answer with the actual xaml in the project and they are the same. The MahApps.Metro.dll file is in the $(LocalAppData)\Markdown Monster directory.
I tried to reference it with the full path, but the same error.
I then copied the MahApps.Metro.dll file to the PanDocMarkdownParserAddin directory and removed the old reference and added this file as the reference. Still the same error!
Any other idea on what can be wrong?
// Anders
Took a look. This addin hasn't been updated in quite some time, so I think it's a bit out of date.
The quick fix for me when I cloned as:
- Change the project target to .NET 4.7.2
This is required to match Markdown Monsters current .NET Runtime. Once you do that the code should compile with the stock project straight from Github.
I've updated the project...
+++ Rick ---