3

Without much luck I've been trying to attach the HTMLTidy c++ library dll within Visual Studio, however everytime I get various errors with different builds. I'm adding a reference to the project and then manually selecting the dll, which has been copied into a lib folder within the project folder.

The first dll I tried was from Mark Beaton, and I'm using his HTMLTidy wrapper as it seems the most up to date. The standard Win32 one was built.

Mark Beaton Builds

I've also tried the build from the official HTMLTidy page, again the dll

Official Build

The error when referencing, please help! I've tried compiling from source, but the source doesn't seem compatible with VS 2010.

alt text

wonea
  • 4,783
  • 17
  • 86
  • 139

1 Answers1

6

libtidy.dll is an unmanaged C DLL, so you can't add a reference to it in Visual Studio's Add Reference dialog. You need to build the C# code from https://github.com/markbeaton/TidyManaged into a managed DLL, and add a reference to that DLL instead.

Make sure that libtidy.dll is copied to your output folder; you can achieve this by adding the DLL file to your project, and changing its properties to "Copy to Output".

Bradley Grainger
  • 27,458
  • 4
  • 91
  • 108
  • 1
    Can you explain this? I am having the same problem. I downloaded the TidyManaged project from git. Then I added libtidy.dll into this project and changed its property "Copy to Output Directory" to "Copy if newer" and compiled the project. Now, libtidy.dll exists in TidyManaged/bin/Debug directory. I added reference to TidyManaged.dll to my other project but with same error still. – Mudasser Hassan Mar 17 '14 at 12:31