Could not load file or assembly 'System.Web.Silverlight' or one of its dependencies

  • Thread starter Thread starter J055
  • Start date Start date
J

J055

Hi

I had a blue screen on my Windows Server 2008 x64 today. I had a VS solution
open at the time. Now when I go to debug the solution I get this error:

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

It work before the crash. The file is in the web project bin folder. The
solution builds without errors. I can open another project which uses the
Silverlight assembly and that works fine. I've tried removing and adding
assembly references to the projects. I cleared the files from here:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

It seems something has got corrupted but I've no idea what it can be and how
to fix it.

What can I do to fix the problem?

Thanks
Andrew

This is the stack trace in case this helps:


[FileLoadException: Could not load file or assembly 'System.Web.Silverlight'
or one of its dependencies. The parameter is incorrect. (Exception from
HRESULT: 0x80070057 (E_INVALIDARG))]

[FileLoadException: Could not load file or assembly 'System.Web.Silverlight,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of
its dependencies. The parameter is incorrect. (Exception from HRESULT:
0x80070057 (E_INVALIDARG))]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection) +416
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence
assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +190

[ConfigurationErrorsException: Could not load file or assembly
'System.Web.Silverlight, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter
is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
assemblyName, Boolean starDirective) +11200744
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
+388
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
+232
System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection
compConfig) +210
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath
configPath, Boolean supportLocalization, String outputAssemblyName) +76
System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean
isPrecompiledApp) +281
System.Web.Compilation.BuildManager.CompileGlobalAsax() +50
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +676

[HttpException (0x80004005): Could not load file or assembly
'System.Web.Silverlight, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter
is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+76
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1012
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025

[HttpException (0x80004005): Could not load file or assembly
'System.Web.Silverlight, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The parameter
is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11294470
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +4335156
 
Hi Andrew,

As for the ASP.NET page that contains the silverlight control, does it
report error both at your debugging time and just "view in browser"? Also,
if you have IIS server, have you tried publish or deploy the project to IIS
server to see whether it works?

Since you mentioned that another project with the same assembly works, it
does likely to be a project specific data corruption. One common approach
for such issue is creating a new project and import the pages and files
from the original project manually so as to eliminate those problems that
are potentially caused by project data corruption. I think you can also try
this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.


--------------------
From: "J055" <[email protected]>
Subject: Could not load file or assembly 'System.Web.Silverlight' or one of its dependencies
Date: Wed, 10 Jun 2009 17:55:28 +0100
Hi

I had a blue screen on my Windows Server 2008 x64 today. I had a VS solution
open at the time. Now when I go to debug the solution I get this error:

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

It work before the crash. The file is in the web project bin folder. The
solution builds without errors. I can open another project which uses the
Silverlight assembly and that works fine. I've tried removing and adding
assembly references to the projects. I cleared the files from here:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

It seems something has got corrupted but I've no idea what it can be and how
to fix it.

What can I do to fix the problem?

Thanks
Andrew

This is the stack trace in case this helps:


[FileLoadExc
 
Steven's solution worked for me

I had the exact same issue (blue screen and then the above error on all referenced assemblies) and creating a new solution and then copying in all of Projects seemed to work.

One caveat - I needed to create a new Virtual directory with a different name and path on my local machine. Apparently, copying the new solution into the same directory with the same virtual path name confused ASP.NET.

After 12 hours of searching, I have a solution.

Thank you both for posting,
Sean
 
Last edited:
Back
Top