I'm trying to deploy a website and I'm getting the following error :
Request for ConfigurationPermission failed while attempting to access configuration section 'system.web/globalization'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared. ---> System.Security.SecurityException: Request for the permission of type 'System.Configuration.ConfigurationPermission, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed.
The problem is that I haven't even defined that section in my webconfig file. Therefore I tried to define it as follow :
1) I added this code at the bottom of my webconfig file (just before the closing configuration tag)
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="fr-FR"
uiCulture="fr-FR"
/>
2) I added this code in the section part of the file :
<configSections>
<section type="System.Web.Configuration.GlobalizationSection, System.Web.Globalization" name="globalization" requirePermission="false" />
</configSections>
But it's still not working. I'm on a shared hosting plan so I can't change the trust level of my application. I'm not very skilled with webconfig, I made some researchs on msdn and google to come up with this solution. But unfortunately I'm still getting the same error. Any idea ?
Update: I noticed that in many examples the PublicKeyToken, VersionNumber etc.. are written in the type attribute. I'll try to find the correct informations for the assembly I'm using. Well, I added more details about the assembly but it didn't work :
<section type="System.Web.Configuration.GlobalizationSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a " allowDefinition="Everywhere" name="globalization" requirePermission="false" />