Pages

Thursday, July 12, 2012

HRESULT: 0x80070057 (E_INVALIDARG)

Very annoying problem for a good while today. I happened to be reverting my code back to a previous version of the repository on SVN. We needed to roll back some changes, and to my surprise after going back to the previous version I wasn't able to build the solution anymore, showing me a weird error:
"Could not load file or assembly … The parameter is incorrectHRESULT: 0x80070057 (E_INVALIDARG)".

That's it, no more explanation. Visual Studio didn't even tell me a line in the source code, or a project where the incidence was taking place. Arrrrgggg!

Well, I don't know the reason for this occurrence but for sure the previous version of the code used to compile with no problems. As it turns out, by going to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\NameOfYourProject and removing everything in there, you should be able to fix the problem. After removing that folder, try to compile again in Visual Studio and you should be good now.

I didn't get to know the reason for this, as the exception message really doesn't tell you much. But for sure my friend, you don't have to re-install Visual Studio as many people out there suggest.

No comments:

Post a Comment