RadScriptManager unable to load System.Windows

5 posts, 0 answers
  1. Andy Grauch
    Andy Grauch avatar
    2 posts
    Member since:
    May 2010

    Posted 07 May 2010 Link to this post

    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
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 10 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Grauch
    Andy Grauch avatar
    2 posts
    Member since:
    May 2010

    Posted 11 May 2010 Link to this post

    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
  5. Ed Davis
    Ed Davis avatar
    4 posts
    Member since:
    Jun 2012

    Posted 02 Mar 2011 Link to this post

    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.
  6. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 09 Mar 2011 Link to this post

    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!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017