Acces denied to mscorlib?
Hi! I have installed a WCF service on a Windows 2008 with service pack 2 but have some problems. When the application are installed in the IIS7 I get the following exception when trying to browse the svc : Server Error in '/MyApp5Service' Application. -------------------------------------------------------------------------------- Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. 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. Stack Trace: [SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.IdentityModel.Selectors.X509CertificateStore..ctor(StoreName storeName, StoreLocation storeLocation) +62 System.ServiceModel.Security.SecurityUtils.GetCertificateFromStoreCore(StoreName storeName, StoreLocation storeLocation, X509FindType findType, Object findValue, EndpointAddress target, Boolean throwIfMultipleOrNoMatch) +70 System.ServiceModel.Security.SecurityUtils.GetCertificateFromStore(StoreName storeName, StoreLocation storeLocation, X509FindType findType, Object findValue, EndpointAddress target) +34 System.ServiceModel.Security.X509CertificateRecipientServiceCredential.SetCertificate(StoreLocation storeLocation, StoreName storeName, X509FindType findType, Object findValue) +49 System.ServiceModel.Configuration.X509RecipientCertificateServiceElement.ApplyConfiguration(X509CertificateRecipientServiceCredential cert) +207 System.ServiceModel.Configuration.ServiceCredentialsElement.ApplyConfiguration(ServiceCredentials behavior) +241 System.ServiceModel.Configuration.ServiceCredentialsElement.CreateBehavior() +163 System.ServiceModel.Description.ConfigLoader.LoadBehaviors(ServiceModelExtensionCollectionElement`1 behaviorElement, KeyedByTypeCollection`1 behaviors, Boolean commonBehaviors) +11156099 System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +188 System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +55 System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName) +35 System.ServiceModel.ServiceHostBase.ApplyConfiguration() +69 MyApp.ServiceImplementation.CustomHostService.ApplyConfiguration() in C:\MyApp\TeamFoundation\MyApp Release 0.19\Source\Service Interface\MyApp.ServiceImplementation\CustomHostServiceFactory.cs:32 System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +190 System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +32 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +139 MyApp.ServiceImplementation.CustomHostService..ctor(Type serviceType, Uri[] baseAddresses) in C:\MyApp\TeamFoundation\MyApp Release 0.19\Source\Service Interface\MyApp.ServiceImplementation\CustomHostServiceFactory.cs:24 MyApp.ServiceImplementation.CustomHostServiceFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) in C:\MyApp\TeamFoundation\MyApp Release 0.19\Source\Service Interface\MyApp.ServiceImplementation\CustomHostServiceFactory.cs:18 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +331 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11666348 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016 The certificate are properly installed. Why do I get this exception? And how do I solve it?
December 15th, 2009 6:05pm
Hi! This was solved by changed the .NET Trust Levels on the application in IIS7 from minimal to full. This was already set to full in Vista.
Free Windows Admin Tool Kit Click here and download it now
December 17th, 2009 3:45pm


