nea / MarkdownViewerPlusPlus

A Notepad++ Plugin to view a Markdown file rendered on-the-fly
MIT License
1.17k stars 143 forks source link

"This ANSI plugin is not compatible with your Unicode Notepad++." error #70

Closed monoblaine closed 6 years ago

monoblaine commented 6 years ago

Issue description

I've tried to run Notepad++ using a a custom-built MarkdownViewerPlusPlus.dll but I get the following error:

This ANSI plugin is not compatible with your Unicode Notepad++.

MarkdownViewerPlusPlus.dll is not compatible with the current version of Notepad++.

So far I've tried the following branches:

Other info

Also, I guess the active solution platform needs to be "Any CPU" because if I choose the other options (either x86 or x64) I get the following error:

MarkdownViewerPlusPlus.il(421393) : warning : Method has no body, 'ret' emitted
MarkdownViewerPlusPlus.il(421398) : warning : Method has no body, 'ret' emitted
MarkdownViewerPlusPlus.il(421407) : warning : Method has no body, 'ret' emitted

Environment

monoblaine commented 6 years ago

More info

I managed to get it work for the 0.8.1 branch with the following steps:

The only problem that remains is that I cannot get it work if I build the project using Release mode. Notepad++ launches with no alert, warning or anything. But the markdown viewer won't show up.

nea commented 6 years ago

Hi @monoblaine

The reason you cannot build it is because I have a custom PDFSharp Version in my personal, local NuGet that wasn't available when I was building it, because I updated some dependencies I required on all ends in HTMLRenderer etc. As soon as PDFSharp is updated, too, I will switch back.

Release build does not work. AnyCPU may not be selected. x86 or x64.

Best

DimitrijeK commented 6 years ago

Hi @nea & @monoblaine,

I recently figure it out so I though it would be good to share how I did it. I used VS2017 and the newest verision of NotePad++. After adding all missing packages and downgrading PdfSharp package to 1.50.4000-beta3b, I was able to succesfully build the solution. Before you build make sure that you have Debug and x86 selected. After building VS2017 will generate .dll file in the bin folder of your project.

After I tried to copy .dll file to plugins folder of NP++ I was getting the following error:

-The ANSI plugin is not compatible with your Unicode Notepad++
-MarkDownViewerPlusPlus.dll is not compatible with the current version of your Notepad++

Then I got around this by installing Plugin Manager for NP++ (PluginManager_v1.4.11_UNI.zip)

-https://github.com/bruderstein/nppPluginManager/releases

Then I installed MarkDownViewerPlusPlus thru plugin manager, and then copied the .dll file (Debug, x86) from the previous build and replaced the one installed thru plugin manager. After that I was able to open Notepad++ with no errors and MarkDown plugin was working!!!

Thank you for your time!!!!! Hope somebody finds this helpful!

monoblaine commented 6 years ago

Hi @DimitrijeK,

When you build the project, MarkDownViewerPlusPlus.dll is supposed to get automatically copied to the plugins folder of Notepad++. There's actually a build task for that in MarkdownViewerPlusPlus.csproj:

<Copy Condition="Exists('C:\Program Files (x86)\Notepad++\plugins\') AND '$(PlatformTarget)'=='x86'" SourceFiles="$(TargetPath)" DestinationFolder="C:\Program Files (x86)\Notepad++\plugins\" ContinueOnError="false" />

That was probably not happening because you didn't have the Plugin Manager installed. Now that you've installed it, things should work that way. (Just make sure you close Notepad++ before you build the project.)

DimitrijeK commented 6 years ago

Hi @monoblaine,

Yeah I know it is supposed to copy the dll file after you build it, but I was at work and the pc I am working won't give me premission to copy files thru that build process, so I just commented out that copy condition. But I get what you are trying to say.

Thank you!