29

My computer blue screened. After my computer restarted, I ran my Silverlight application and got this error:

Could not load file or assembly 'AsyncCtpLibrary' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

I actually got a couple of errors regarding RIA services not being able to generate code because a directory name had invalid characters. I cleared that up by deleting everything in the bin and obj directories. Clearly there is something corrupt.

I've pulled the DLL back down and set it to copy local and I still get that error, only after I run the program. I'm not sure if it's something where the DLL is corrupt in the GAC or something like that.

EDIT: After reinstalling the Async CTP DLL and checking the GAC, I decided to turn on Assembly Binding logging which gave me this information (along with a lot more).

ERR: Failed to complete setup of assembly (hr = 0x80070057). Probing terminated.

Matt Hudson
  • 7,329
  • 5
  • 49
  • 66
  • I reinstalled the AsyncCTP and I still get the same error. Does anyone know how to turn on Assembly Binding Logging so I can see the real error? – Matt Hudson Feb 13 '11 at 23:43
  • Did you install the VS 2010 SP1 Beta? If so, it's incompatible with the Async CTP (which provides that assembly). You'll have to either uninstall SP1 beta or the Async CTP. – Reed Copsey Feb 12 '11 at 00:39
  • No I have VS 2010 Ultimate. The Async CTP worked just fine before the crash. – Matt Hudson Feb 12 '11 at 00:42
  • I would recommend repairing Visual Studio, in that case. – Reed Copsey Feb 12 '11 at 00:55
  • You should sort out the problem which caused your bluescreen, then reinstall Windows. Sounds insane, but if your computer is faulty, things like this can and do happen. – servermanfail Feb 12 '11 at 05:45

5 Answers5

35

Okay, so I figured it out. I had to delete everything in this directory: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\

Matt Hudson
  • 7,329
  • 5
  • 49
  • 66
  • 6
    **Comment by [Jaider](http://stackoverflow.com/users/480700/) (rejected edit):** Also clear the files at: `C:/Users[username]/AppData/Local/Temp/Temporary ASP.NET Files/`. This is to complement your answer, based on [this website](http://www.solutioncottage.com/ShowSolution.aspx?solID=59). Was very helpful to me. – Anne Dec 12 '11 at 22:19
  • 1
    +1 I got a similar error with .Net 3.5 (same error code), and deleting everything in C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files fixed it. Thanks for the tip! – Polyfun Jan 05 '12 at 10:21
  • 4
    It is really so Strange but on my windows 7 (x64) pc i had to delete files in "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\" NOT Framework64, By the way thanks a lot you just saved my life. – NET3 Oct 02 '12 at 17:30
  • 2
    For my C:\Users\loggedinuser\AppData\Local\Temp\Temporary ASP.NET Files\ EVERYTHING – Tom Stickel Jan 28 '13 at 04:27
  • 1
    +1 can confirm this works with solution containing Winform, ExcelVSTOAddIn & ClassLibraryAPI. Simply delete all files in `C:\Users\loggedinUser\AppData\Local\Temp` – Jeremy Thompson May 20 '13 at 04:59
  • Happened to me when I ran out of power :) I had to delete file in both Framework/.. and Framework64/.. – Gorgi Rankovski Nov 25 '13 at 10:35
19

Delete all files from the following folders and try again:

C:\Users[username]\AppData\Local\Temp\Temporary ASP.NET Files\

.NET 4.0

%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ %SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\

.NET 2.0

%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ %SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\

Alexander van Trijffel
  • 2,916
  • 1
  • 29
  • 31
1

Have you tried starting devenv in safemode?

devenv.exe /SafeMode

If this works you can try resetting the settings files to:

devenv.exe /ResetSettings

Instead of repairing Visual Studio you reset the user data back to their defaults with:

devenv.exe /resetuserdata
Stephen Gennard
  • 1,910
  • 16
  • 21
0

If you think your GAC has become corrupted, I suppose you could take a look at the DLL in there. I bet you could find a checksum for the dll online, or re-download it. I'd follow Reed's advice, though -- that seems more likely to treat the root issue.

Dawson Toth
  • 5,580
  • 2
  • 22
  • 37
-1

Simply delete temporary file in Temporary folder. enter %temp% in Run command to open temp folder and then delete all file and folder. After this your problem will resolved.

Shree Krishna
  • 8,474
  • 6
  • 40
  • 68
manan2809
  • 29
  • 4