Could not load file or assembly ‘itextsharp, Version=5.5.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca’ or one of its dependencies

I have used itextsharp library to generate pdf in my asp.net web application. It was working fine untill today when suddenly my laptop on which the application was running in the debug mode went off. When I switched on my laptop again and tried to run the application I satrted getting this error:

“Could not load file or assembly ‘itextsharp, Version=5.5.0.0,
Culture=neutral, PublicKeyToken=8354ae6d2174ddca’ or one of its
dependencies. The parameter is incorrect. (Exception from HRESULT:
0x80070057 (E_INVALIDARG))”

What could be the reason and how can I solve this? Please help.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Try removing the reference and add again…!!! Seems like the reference got removed due to improper shutdown.

Method 2

Try to clean Temporary Files of Asp.Net, sometime I’ve experimented strage cases of files corruption(I know this should be a comment but It’s verbose):

1 – Open notepad and paste the following.

@ECHO OFF
ECHO Per­form­ing IIS Reset
IISRESET
ECHO Delet­ing Cache
Del /F /Q /S %LOCALAPPDATA%MicrosoftWebsiteCache*.*
Del /F /Q /S %LOCALAPPDATA%TempVWDWebCache*.*
Del /F /Q /S “%LOCALAPPDATA%MicrosoftTeam Foundation3.0Cache*.*“
Del /F /Q /S “C:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files*.*“
Del /F /Q /S “C:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files*.*“
Del /F /Q /S “C:WindowsMicrosoft.NETFramework64v2.0.50727Temporary ASP.NET Files*.*“
Del /F /Q /S “C:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET Files*.*“
ECHO Complete

2 – Save the file as a .bat file.

3 – run it from the com­mand prompt.

Method 3

I had a backup of my project. Restored the backup and it worked. Thanks for all the suggestions.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x