Upgrades Questions on upgrading to version 5.x.
Version 5.x > Upgrades > Security Exception error after upgrade to 5.5 View modes: 
User avatar
Member
Member
gstaylor-sfopera - 8/24/2010 1:40:19 PM
   
Security Exception error after upgrade to 5.5
After doing an upgrade to 5.5 I get a "Security Exception" error;

"System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."

We're using IIS 7 and when I try to load the .NET Compilation settings, it gives an error about a duplicate key entry;

Filename: web.config
Line number: 83
Error: Cannot add duplicate collection entry with type "add" with unique key attribute "assembly" set to "System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKey Token=B03F5F7F11D50A3A"

The web.config file I used was in the upgrade package and the only thing I modified in that file was to add the connection string. I've tried commenting out that particular line but it then gave a similar error about the line immediately following (I then uncommented the line).

Any resolution? A Google search reveals all kinds of different results.

User avatar
Member
Member
gstaylor-sfopera - 8/24/2010 2:16:53 PM
   
RE:Security Exception error after upgrade to 5.5
And here is the error displayed on the browser when I try to access the site;

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/25/2010 3:49:37 AM
   
RE:Security Exception error after upgrade to 5.5
Hi,

Could you please confirm that you have followed all the instructions during upgrade?

Is your Kentico CMS nested under some other .Net web site?
Have you tried to clear the .Net cache?

Could you please also check some forms using Google, for example:
http://forums.asp.net/t/1371394.aspx
http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/1505d7e6-59dc-4997-b707-9e9736a1f978

Best regards,
Juraj Ondrus

User avatar
Member
Member
gstaylor-sfopera - 8/25/2010 11:03:00 AM
   
RE:Security Exception error after upgrade to 5.5
Turns out it was an IIS7 application pool setting.

I found this article, http://geekswithblogs.net/ProjectLawson/archive/2009/05/05/iis-system.web.aspnethostingpermission-exception-on-windows-7-rc.aspx, and it pointed me to the fix.

You need to set the Application Pool setting "LoadUserProfile" to "True". It's set to "False" by default and changing this enabled the site to load without errors.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 8/26/2010 5:38:12 AM
   
RE:Security Exception error after upgrade to 5.5
Hi,

Thank you for the update and I am glad that you were able to fix the issue.

Best regards,
Juraj Ondrus

User avatar
Member
Member
katrien.v-skynet - 2/26/2011 10:23:31 AM
   
RE:Security Exception error after upgrade to 5.5
I didn't do the upgrade. I installed a Kentico 5.5 on my webspace (shared hosting). Everything worked. But than a few weeks later the website doesn't load anymore, and in those two weeks that passed there where no more changes done to the website, only some pictures were oploaded. It loads for 1/3 and that it stops (you can trie it on tarascheers.com). I get no error. So I contacted my hosting provider and they said they can't see what it is they only get the error wich you discribed here.
So on my advice they changed the application pool like you discribed here but the problem stays the same. I'm not a developer so I really have no idea what could be wrong.
Can anyone help me out?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/7/2011 6:35:08 PM
   
RE:Security Exception error after upgrade to 5.5
Hi,

Not sure what everything should be on the web site, but it seems to be working fine now. Could you please confirm?

Have you also checked the links mentioned in this thread?

Best regards,
Juraj Ondrus

User avatar
Member
Member
seanbun - 7/14/2011 7:15:42 PM
   
RE:Security Exception error after upgrade to 5.5
Great to see this solution. I had same error when I upgrade my site.

It is worth to put this in the upgrade manual.

Thanks,
Matt

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 7/15/2011 3:56:39 AM
   
RE:Security Exception error after upgrade to 5.5
Hi,

Thank you for the suggestion. We will consider it for the future versions. However, this problem is not that often and it is already discussed here on forums - anyway, we will see how it will go.

Best regards,
Juraj Ondrus