This is a migrated thread and some comments may be shown as answers.

RadScriptManager unable to load System.Windows

4 Answers 115 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Andy Grauch
Top achievements
Rank 1
Andy Grauch asked on 07 May 2010, 09:09 PM
Hello,

In my web application, I have a master page with a RadScriptManager control.  I'm getting the following error on page load:

Could not load file or assembly 'System.Windows,Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' orone of its dependencies. The system cannot find the file specified.


Based on the stack trace, the error appears to be thrown from the RadScriptManager constructor:

[FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.]
   System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 
   	typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0 
   System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] 
   	typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180   
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] 
	genericMethodArguments) +192   System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord 
	caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, 
	MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[]
	attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean&
	ctorHasParameters, Boolean& isVarArg) +115   
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, 
	Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean 
	isDecoratedTargetSecurityTransparent) +426   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly
	assembly, RuntimeType caType) +103   
   System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +33   
   System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly) +76   
   System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly() +388   
   System.Web.UI.ScriptManager..ctor() +26   
   Telerik.Web.UI.RadScriptManager..ctor() +14
The error only occurs the first time I load a page after a build of the application.  As soon as I refresh the page, the error goes away and the application functions as expect.

The error started occurring as soon as I added a Silverlight 3 application in my web app project.

Why are RadScriptManager and the .NET ScriptManager attempting to load a Silverlight dll?  Obviously, this dll is not in the bin directory of the web app.  Any ideas as to how I can make this error go away?

I'm using VS 2010, .NET 4.0, Silverlight 3, and Telerik RadControls for ASP.NET Ajax version 2010.1.415.40.

Thanks,
Andy

4 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 10 May 2010, 12:31 PM
Hi Andy Grauch,

That's an interesting problem indeed. Try replacing RadScriptManager with ScriptManager. This will let us know if the problem is in the base implementation or in our code. If it turns out to be in our code then we'll appreciate a sample project that we can debug locally.

I hope this helps.

Best wishes,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Andy Grauch
Top achievements
Rank 1
answered on 11 May 2010, 04:43 PM
Thanks for the suggestion.  However, the problem seems to have resolved itself.   The "fix" was to delete my solution and fetch a fresh copy from source control.  For whatever reason, I can rebuild this new copy without seeing the error.  I have not been able to reproduce the error when building and deploying the application to test and staging servers.  Must have been something local to my development environment.

Andy
0
Ed Davis
Top achievements
Rank 1
answered on 02 Mar 2011, 06:38 PM
I had this same issue pop with when I added silverlight 4, but only after adding a silverlight class library did it start happening.

I replaced the radscriptmanager with the base scriptmanager and still got the error.

I'm trying to recreate the solution file now to see if this resolves my issue as well.

Edit:
Still no luck with this.
I removed system.windows.controls , system.windows.controls.data.input, system.windows.controls.navigation
dll's from the bin directory and rebuilt the solution so they would be regenerated which they were. Still have the error, so my current build can't be put into production until this can be resolved.
0
Simon
Telerik team
answered on 09 Mar 2011, 11:17 AM
Hi Ed Davis,

This can be a problem with your GAC.

First, please try try uninstalling and then installing Silverlight again to see if it fixes it.

If it does not, please paste here the stack trace of the exception in case it contains information that may lead us to the root cause.

Kind regards,
Simon
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
ScriptManager and StyleSheetManager
Asked by
Andy Grauch
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Andy Grauch
Top achievements
Rank 1
Ed Davis
Top achievements
Rank 1
Simon
Telerik team
Share this question
or