Cant open page after trying to upgrade site

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
1/6/2014 10:57:39 AM
Gravatar
Total Posts 47

Cant open page after trying to upgrade site

Today I sat down to upgrade my 2 mojoportal sites.

The first worked just fine and the second didnt.

When I go to www.site.se/setup/default.aspx

I get the following error, hope someone can help me out here.

 

Could not load file or assembly 'AjaxControlToolkit' 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 'AjaxControlToolkit' 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 'AjaxControlToolkit' 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 'AjaxControlToolkit' 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.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 'AjaxControlToolkit' 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) +11317880 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.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +11307058 System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +551 [HttpException (0x80004005): Could not load file or assembly 'AjaxControlToolkit' 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() +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 'AjaxControlToolkit' 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) +11411878 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +11285368

1/6/2014 11:03:39 AM
Gravatar
Total Posts 18439

Re: Cant open page after trying to upgrade site

Hi Matz,

1. Make sure you uploaded the ajaxcontroltoolkit.dll that shipped with mojoportal in the bin folder

2. Make sure you used the correct mojoPortal package for your .NET framework version. ie it sounds like the site is using .NET 2 or .3.5 but you uploaded the .NET 4 package of mojoportal. Look around in your hosting control panel and see if it has a place to set the framework version to 4.

Hope that helps,

Joe

1/6/2014 11:06:39 AM
Gravatar
Total Posts 47

Re: Cant open page after trying to upgrade site

Thanks for quick answer!

Can I somehow see what .net the site was running?

I cant login to se it.

1/6/2014 12:37:02 PM
Gravatar
Total Posts 47

Re: Cant open page after trying to upgrade site

Restored all my files and the site came back up.

I can now se it says .Net 2.0. How can I upgrade to .Net4.0?

1/6/2014 12:50:21 PM
Gravatar
Total Posts 18439

Re: Cant open page after trying to upgrade site

.NET framework versions are a kind of confusing because 2.0 and 3.0 and 3.5 are all really framework version 2 and .NET 4 and 4.5 are framework version 4. 

If your hosting account supports framework 4 then somewhere in your web control panel there should be a place to select .NET 2 or 4. If you don't have any option like that contact your host and see if they offer .NET 4 hosting, ideally you want .NET 4.5 but again you will never see 4.5 listed in the control panel it will still say 4.

The different framework versions require different application pools so that is what the setting in the control panel does it selects an application pool for the correct framework and that makes the site use the chosen framework.

To use mojoPortal hosted in .NET 3.5 (which is the oldest version we support) you would use the mojoportal package for net35, to use mojoPortal hosted in .NET 4 you would use the net40 package of mojoPortal.

1/6/2014 12:57:39 PM
Gravatar
Total Posts 47

Re: Cant open page after trying to upgrade site

So its realy just to choose .net4 of the application pool for the site and then copy the files for .net4 installation and run setup?

1/6/2014 1:01:56 PM
Gravatar
Total Posts 18439

Re: Cant open page after trying to upgrade site

yes, and make sure you use all the files, the Web.config files are different for 3.5 vs 4.0 so very important to use the new one and restore any customizations from the old one such as machinekey

1/6/2014 1:33:37 PM
Gravatar
Total Posts 47

Re: Cant open page after trying to upgrade site

Thanks! Will try it tomorrow!

1/6/2014 1:41:30 PM
Gravatar
Total Posts 18439

Re: Cant open page after trying to upgrade site

Thanks for the beers! They are very appreciated.

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.