+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom Control .dll Upload Problem

Custom Control .dll Upload Problem

4 posts, 0 answered
  1. Sam
    Sam avatar
    21 posts
    Registered:
    18 Aug 2010
    16 Sep 2010
    Link to this post

    Hi, I'm attempting to upload a dll which contains a custom control.  I've tried changing the target framework of the class library and double checked that the target framework for the Sitefinity site is the same (both are v3.5).  Where can I find more information on troubleshooting steps?

    Server Error in '/CmaTest' Application.

    Could not load file or assembly 'Cma.Sitefinity.Controls' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.BadImageFormatException: Could not load file or assembly 'Cma.Sitefinity.Controls' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Cma.Sitefinity.Controls' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    

    Stack Trace:

    [BadImageFormatException: Could not load file or assembly 'Cma.Sitefinity.Controls' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
       System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
       System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
       System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
       System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
       System.Reflection.Assembly.Load(String assemblyString) +28
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
    
    [ConfigurationErrorsException: Could not load file or assembly 'Cma.Sitefinity.Controls' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
       System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
       System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
       System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
       System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
       System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
       System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +600
       System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
       System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320
    
    [HttpException (0x80004005): Could not load file or assembly 'Cma.Sitefinity.Controls' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
       System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
    
    [HttpException (0x80004005): Could not load file or assembly 'Cma.Sitefinity.Controls' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8897659
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
       System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    16 Sep 2010
    Link to this post
    Hello Sam,

    Thank you for using our services.

    Is the assembly into which your control is built referencing other libraries which might be .NET 4.0?

    Kind regards,
    Radoslav Georgiev
    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. Sam
    Sam avatar
    21 posts
    Registered:
    18 Aug 2010
    16 Sep 2010
    Link to this post
    They are all 2.0 or 3.5.  What I did was open the website in VS2008, added a class library to it, added a reference to System.Web, added a reference to both Telerik.Cms and Telerik.Framework from the bin of the website.

    All other references are what you would normally have in a 3.5 class library.  My custom control inherits from WebControl (I'm assuming this isn't causing the issue), and there's nothing complicated or odd that would be suspect.

    Thanks for such a prompt reply - much appreciated!
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    16 Sep 2010
    Link to this post
    Hi Sam,

    Is it possible that the website is using the Sitefinity .NET 2.0 release. You can find how to check the Sitefinity version in this article.

    Best wishes,
    Radoslav Georgiev
    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
Register for webinar
4 posts, 0 answered