1

Error Occurs while running C# project, which uses itextsharp.dll to genereate pdf file

The content of error:

"Could not load file or assembly 'itextsharp, Version=5.4.1.0, Culture=neutral, PublicKeyToken=*****or one of its dependencies. The located assembly's manifest definition does not match the assembly reference' 

Can anyone help me?

5
  • Have you added the iTextsharp dll in the namespace ? If yes then is it giving error line there ? May 24, 2013 at 6:43
  • yes i added dll to reference and also included that namespace too. May 24, 2013 at 13:33
  • so exactly where you are getting the error ? In consuming the classes from dll or in the namespace addition ? May 24, 2013 at 13:34
  • As googled its seen to be dll not loaded properly. Error raised at program.cs page, in 'Application.Run(new Form1());' May 24, 2013 at 13:48
  • Thanks for ur replies, error got fixed, i am using appconfig file in my project,in that there was a tag named <runtime> i removed that, which was genreated by .net while including dll May 24, 2013 at 14:12

2 Answers 2

1

Check first, whether the referenced version in your solution matches 5.4.1.0. You could try to select the reference in the project References folder and set "Specific Version" to false.

For further hints, see The located assembly's manifest definition does not match the assembly reference

0

you have to paste the following 4 files

 itextsharp.dll,
 itextsharp.pdfa.dll,
 itextsharp.xml,
 itextsharp.xtra.dll 

in current folder, from where you are executing your .exe file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.