简体   繁体   中英

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.

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

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%\Microsoft\WebsiteCache\*.*
Del /F /Q /S %LOCALAPPDATA%\Temp\VWDWebCache\*.*
Del /F /Q /S “%LOCALAPPDATA%\Microsoft\Team Foundation\3.0\Cache\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\*.*“
Del /F /Q /S “C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\*.*“
ECHO Complete

2 - Save the file as a .bat file.

3 - run it from the command prompt.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question Could not load type 'iTextSharp.text.html.HtmlParser' from assembly 'itextsharp, Version=5.5.5.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' Could not load file or assembly 'Noesis.Javascript, Version=0.0.0.0, Culture=neutral, PublicKeyToken=ae36d046c7f89f85' or one of its dependencies Could not load file or assembly 'XXX, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies Could not load file or assembly 'Dapper, Version=1.8.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies C#: Could not load file or assembly 'OpenPop, Version=2.0.4.369, Culture=neutral, PublicKeyToken=null' or one of its dependencies Could not load file or assembly 'BouncyCastle.Crypto, Version=1.8.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=myKey' or one of its dependencies. Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XX' or one of its dependencies Could not load file or assembly 'AjaxMin, Version=4.97.4951.28478, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f' or one of its dependencies Could not load file or assembly 'MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM