Moving iis7 to another server. Generic 503 error - iis-7

I was moving iis to another server and I get a generic service unavailable 503 error. When looking at this error in the log:
IISMANAGER_ERROR_LOADING_PROVIDER_TYPE
IIS Manager could not load type 'Microsoft.Web.Management.PlatformInstaller.Server.PlatformInstallerModuleProvider, Microsoft.Web.Management.PlatformInstaller.Server, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35' for module provider 'PlatformInstaller' that is declared in %windir%\system32\inetsrv\config\administration.config. Verify that the type is correct, and that the assembly that contains the module provider is in the Global Assembly Cache (GAC).
Exception:System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Management.PlatformInstaller.Server, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Web.Management.PlatformInstaller.Server, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at Microsoft.Web.Management.Server.AdministrationModuleProvider.GetModuleProvider(String userName, String connectionName)
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].
Process:InetMgr
Connection:VPS2837\VPS2837Admin
Any suggestions? I have tried finding a replacing the C:\Windows\System32\inetsrv\config\administration.config file with 5.0.0.0 instead of 4.0.0.0 for the version of Microsoft web management. Still no luck. Thanks in advice

Related

ServiceStack with shared hosting: SecurityException and ReflectionPermission

I'm facing following problem. I've got Service Stack-based webservice which I want have on shared hosting. When deploying there and trying to open an url I'm getting following error:
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.ReflectionPermission,
mscorlib, Version=4.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.ReflectionPermission, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.] System.Security.CodeAccessSecurityEngine.Check(Object
demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark) +34
System.Security.CodeAccessPermission.Demand() +46
System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Module m,
StackCrawlMark& stackMark, Boolean skipVisibility) +243
System.Reflection.Emit.DynamicMethod..ctor(String name, Type
returnType, Type[] parameterTypes, Module m, Boolean skipVisibility)
+48 ServiceStack.Text.ReflectionExtensions.GetConstructorMethodToCache(Type
type) +586
ServiceStack.Text.ReflectionExtensions.GetConstructorMethod(Type type)
+68 ServiceStack.Text.ReflectionExtensions.CreateInstance(Type type) +8
ServiceStack.ServiceHost.ServiceController.RegisterNServiceExecutor(Type
requestType, Type serviceType, ITypeFactory serviceFactoryFn) +123
ServiceStack.ServiceHost.ServiceController.RegisterNService(ITypeFactory
serviceFactoryFn, Type serviceType) +287
ServiceStack.ServiceHost.ServiceController.Register(ITypeFactory
serviceFactoryFn) +96
ServiceStack.ServiceHost.ServiceManager.Init() +50
ServiceStack.WebHost.Endpoints.AppHostBase.Init() +43
DarkMindFx.Global.Application_Start(Object sender, EventArgs e) +571
So it seems like ServiceStack cannot perform the reflaction.
I've also tried to
<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
</securityPolicy>
to web.config but as the result hosting returns me an error with this line in web.config.
Does anyone ever faced such issue? Any ideas how to solve it?
The SecurityException is because GoDaddy doesn't support full trust ASP.NET hosting. You can try requesting their support to enable it for your site, otherwise you would need to use a different hosting provider.

SecurityException - Dapper on shared hosting

For my current project I use Dapper. Everything perfect. Then I needed to deploy it on shared hosting. The result can be seen here (copied YSOD):
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.ReflectionPermission,
mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
Stack trace
[SecurityException: Request for the permission of type
'System.Security.Permissions.ReflectionPermission, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.] System.Security.CodeAccessSecurityEngine.Check(Object
demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark) +31
System.Security.CodeAccessPermission.Demand() +46
System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner,
StackCrawlMark& stackMark, Boolean skipVisibility) +9461551
System.Reflection.Emit.DynamicMethod..ctor(String name, Type
returnType, Type[] parameterTypes, Type owner, Boolean skipVisibility)
+40 Dapperx.SqlMapper.CreateParamInfoGenerator(Identity identity) +537 Dapperx.SqlMapper.GetCacheInfo(Identity identity) +376 Dapperx.d__131.MoveNext() +644
System.Collections.Generic.List1..ctor(IEnumerable1 collection) +327
System.Linq.Enumerable.ToList(IEnumerable1 source) +58
Dapperx.SqlMapper.Query(IDbConnection cnn, String sql, Object param,
IDbTransaction transaction, Boolean buffered, Nullable1
commandTimeout, Nullable1 commandType) +199
...
Is there any way how to solve it for (in .NET 4.0)?
As far as I understand what I've read so far, the provider has to allow some parts from reflection for the IIS which might be a security risk for them...
Reflection.Emit which is used by Dapper is not allowed in Medium Trust.
You should find a hosting provider that offers Full Trust. discountasp.net is one I have used before.

Hello, someone help to resolve this error. I getting this when ever I am building an app

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.Web.AspNetHostingPermission, System, 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.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) +42
System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +145
System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) +73
System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) +111
System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) +279
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
You should change the application trust level in your web.config
Add something like this to your system.web section:
<system.web>
<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
</securityPolicy>
</system.web>
If it works, decrease your trustLevel to High, then to Medium, then to Low to see which trust level is sufficient for your application.
Actually I found the Issue, the project was created in an network not on my local. Thanks for your time to have look into this

Why am I getting this error: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, ...' failed

Whe I try to run my site locally I get this error:
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.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Stacktrace:
[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase) +0
System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase) +201
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +302
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +64
I'm not running across a UNC share or accessing any shared network resources. It's a .NET 3.5 site running on IIS7 on a windows 7 box.
I don't think I made any changes before this started happening, and since it has I've rebuilt the solution & restarted the computer.
Try the following. It has to do with Application Pool setting, "Load User Profile=True".

asp.net publish problem

My application works fine on localhost. But when I publish it to the server , it throws the exception below.
It was working yesterday, but I added some simple file IO operations to global.asax and some other parts in code, i try to write log to some file in server side ..
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:
[FileNotFoundException: Could not load file or assembly 'MyApplication' or one of its dependencies. The system cannot find the file specified.]
System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +78
System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +64
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +51
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38
My assumption would be that you haven't marked the target folder as an "application" is IIS, meaning it will be looking in the wrong place for the "bin" folder. You can do this in the IIS manager on the server; the folder should have a "cog" icon, indicating that it knows it is an application. If not: right-click on the folder and go into the properties; there should be a "Create Application" button (or similar). Also verify that ASP.NET is set to 2.0.* (on the ASP.NET tab).
(disclosure: there was a "moderator" flag suggesting this belongs on serverfault, but I disagree: knowing how to get an ASP.NET app working (even on a server) is a development issue)
is MyApplication.dll present in the bin folder? check it or give some details more about how you published the website

Resources