After 4.1 upgrade, site fails with ReflectionTypeLoadException
I followed the upgrade instructions from 4.0 SP1 to 4.1 step by step and after the upgrade completed, now my site crashes with this 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. |
|
I was getting this also. Go to the folder where the Sitefinity project manager is installed. Then copy all of the files that are in the _EmptyProject folder, except the "SitefinityWebApp.csproj" and "web.config", and paste them into your site and overwrite the files in your site. Once this was done, I was able to get the site to run. You may also want to re-build your site if you have any custom work in the site.
Hopefully you already have a backup of your files if you need to revert back. I had a hard time upgrading one of my sites. I had reverted back to the beginning a couple of times. Hopefully this will help you get past it.
Thanks for the tip, but unfortunately it didn't fix it. I still have the same error trying to access my site or even the Sitefinity admin console.
Actually I mis-spoke, now there is still an error, but it is a different one:
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. |
|
|
if you encounter this you'll need to rebuild any custom dll's with the newest build of the sitefinity dll's.
Hi Adam,
The error indicates mismatch of the assembly references. Please make sure that your project has correct references to the new dlls. If you have custom class libraries, please add the proper references.
All the best,
Ivan Dimitrov
the Telerik team
I kept getting the error even after updating the references. Apparently, in addition to updating references there are new DLLs to be copied over to the upgraded sites' BIN folder (I copied from _EmptyProject/bin):
- Newtonsoft.Json.dll
- Facebook.dll
yes we did something similar pavel...we had to rebuild with the new reference dlls and then add our custom dll widget. then have to copy all the dlls from the emptyproject folder and then rebuild the sitefinity webapp main site for it to work again.
I'm still getting the first error, looks like an ORM problem?
I've copied over the new files and rebuilt the module and ORM data layer projects in the solution as well. This is a bit of a nightmare.
I couldn't find a new version of the OpenAccess.SDK.dll
I'm wondering if this comes with the stand alone install of ORM? Can't remember, maybe I need to upgrade the ORM tools to 2011 Q1?
Matt
Hello mattc,
Please make sure that you made these OA changes to your custom modules.
Kind regards,
Ivan Dimitrov
the Telerik team
I was getting this error on a brand new site. The solution was to copy all the DLLs from the bin folder under: C:\Program Files (x86)\Telerik\Sitefinity 4.1\_EmptyProject\bin to my bin folder.
There's this behaviour that I'm seeing once you load up the project in VS 2010 and recompile, it actually NUKES dlls that are necessary to run the project!
The DLLs that kept getting deleted were:
- Facebook.dll
- Newtonsoft.json.dll
I put them back, added the whole bin folder to source control, so at least when I compile the files won't be deleted.
See?
==========================================================================================
------ Rebuild All started: Project: SitefinityWebApp, Configuration: Debug Any CPU ------
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\Projects\WebSite\bin\Facebook.dll". Access to the path 'C:\Projects\WebSite\bin\Facebook.dll' is denied.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3607,9): warning MSB3061: Unable to delete file "C:\Projects\WebSite\bin\Newtonsoft.Json.dll". Access to the path 'C:\Projects\WebSite\bin\Newtonsoft.Json.dll' is denied.
SitefinityWebApp -> C:\Projects\WebSite\bin\SitefinityWebApp.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
The deletion of dlls is a bug in VS. It has been reported to Microsoft, but to this day the bug remains. It normally doesn't do it all of the time, but it is a pain.
Really? I'm running VS 2010 Ultimate... 10.0.40219.1 SP1 Rel
Never heard of this behaviour before where VS will arbitrarily decide to blow away DLLs in your bin. Not saying it isn't possible, just saying I've never heard of it.
Chris.
Yes, it is VS. I have seen it do this on different versions of VS. At first I thought it was when I ran a "Build" but later found out that this was occurring when I did the "Rebuild" command also.
I was wondering about this for some time. When I was watching a webinar with Lino Tadros at Falafel, he ran into the same issue. He had mentioned that the ticket had been created for this bug. This is where I got the info from. I tried to do a quick search on Google, but didn't find anything.