Asp.net iis web application (example.com/sub/) - Internal Server Error - asp.net

I have main iis asp.net site (example.com). I add asp.net iis web application (example.com/sub/). Main site (example.com) works fine but (example.com/sub/) shows error
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related
configuration data for the page is invalid.
<section name="pages"
type="System.Web.WebPages.Razor.Configuration.RazorPagesSection,
System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
P.S. (example.com) and (example.com/sub/) have different "4.0 Intregrated" applications pools

Related

Are ADFS 2.0 / SAML Tokens in ASP.NET sticky?

We are running an ASP.NET 4.6 application with ADFS 2.0. The configuration of the web.config ADFS part was created via FedUtil.exe.
We now have the problem that a second instance of the web application still thinks that the user is not authenticated.
auth on server 1 works only on server 1
auth on server 2 works only on server 2
but..
auth on server 1 cannot be recognized on server 2 and vise versa
In our scenario only a sticky session would work in a load balanced environment. I think it is because of the SessionModule which is required:
<modules>
<add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
<add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />
</modules>
Am I right that the SessionModule stores any data of the auth* into a session, so a shared session would not be possible and we are forced to use sticky sessions?
Would IdentityServer3 or IdentityServer4 solve this issue?
It seems to be that the Microsoft.Identity does not provide SAML Tokens without Sticky Sessions: https://leastprivilege.com/2012/07/12/machinekey-based-session-protection-for-wif/

Error installing DNN4 on Windows 8

My company supports a very old DNN4 site. I am attempting to get a local copy running on my Windows 8 computer so that I can test a set of changes requested by the client.
I have added the site to my Default web site in IIS, and have given the site it's own app pool:
When I try to browse to the site to actually install it, however, I get this error (which looks to be complaining about the handlers section of the web.config).
full error text
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070021
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config File \\?\C:\Users\Public\dnn4\web.config
Requested URL http://localhost:80/dnn4
Physical Path C:\Users\Public\dnn4
Logon Method Not yet determined
Logon User Not yet determined
Config Source:
75: </modules>
76: <handlers>
77: <add name="AJAX_ScriptResourceHandler" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0" />
You really shouldn't setup the site under your USERS folder, I would recommend you do it outside of the Users folder in a folder that won't have restrictive permissions.

RIA Services error but not used

I created an ASP.NET MVC WebPages application. Works perfectly local. Works perfectly on the server when I install it as a website. However when it is installed as an IIS application (level below another website, using the same application pool) all it does is throwing this exception:
Could not load file or assembly
'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The system cannot find the file specified.
Apparently something related to WCF RIA services, which is not used. All I use is Linq to SQL. How is this possible?
Server: Windows Server 2008 R2 with IIS 7.5
Check the web.config of your application if it contains an entry like:
<httpModules>
<add name="DomainServiceModule"
type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
It is located in the <system.web> section.
Theres is also another entry like:
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule"
preCondition="managedHandler"
type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</modules>
in the <system.webserver> section.
Remove the entries, then you should not get the exception.
I know it too late, but may be my answer will be useful for some people.
I had similar problem, but no corresponded to IIS.
So, I had web app based on RIA services. This app used separate dll (DAL) which contained some classes attributed by RIA attributes (of course, it had reference to RIA dll). The dll (DAL) was referenced by another app which did not use RIA and raised same error as you mentioned (but only with System.ServiceModel.DomainServices.Server).
This error was raised only during WCF channel creation (ChannelFactory<>). So I suppose WCF should know about all referenced dlls during analyzing of attributes of contract's classes. But I did not found any explanation why WCF don't used only own attributes whithout analizing all of them.

Hosting ASP.NET site in IIS 7

I was hosting published site in IIS 7 on Windows 7 installed machine.
I had done setting for .NET framework version, Security Options but got Error as shown below
HTTP Error 500.19 - Internal Server
Error
The requested page cannot be accessed
because the related configuration data
for the page is invalid. Detailed
Error Information Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x800700b7
Config Error There is a duplicate
'system.web.extensions/scripting/scriptResourceHandler'
section defined
Config File
\?\D:\inetpub\wwwroot\KDAHCSSD\web.config
Requested URL
http://localhost:80/KDAHCSSD/frmLogin.aspx
Physical Path
D:\inetpub\wwwroot\KDAHCSSD\frmLogin.aspx
Logon Method Not yet determined
Logon User Not yet determined
Config Source 13:
sectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup,
System.Web.Extensions,
Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"
14: section
name="scriptResourceHandler"
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions,
Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"
requirePermission="false"
allowDefinition="MachineToApplication"/
15: sectionGroup
name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions,
Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35"
Links and More InformationThis error
occurs when there is a problem reading
the configuration file for the Web
server or Web application. In some
cases, the event logs may contain more
information about what caused this
error.
View more information ยป
How to solve this. What will I need to do?..
Assuming you are running a .Net 4 site, the machine.config will already have defined the scriptResourceHandler. Remove this section from the web.config and you should be fine.
EDIT: Just noticed you say you are running 3.5 and so shouldn't happen, but try removing that section and see if it works.
This can also occur if your application is compiled against the .NET 2.0 CLR and you're trying to run it in a .NET 4.0/4.5 application pool.
If that's the case (as it was for me), switching to the correct app pool solves the problem.

Upgrade asp.net 3.5/IIS6 application to asp.net 4.0/IIS7.5

I am migrating a web application (WebForms) from ASP.NET 3.5 on IIS6 to ASP.NET 4.0 on IIS 7.5.
I created a new project in VS2010 and add the existing source files from the old project and compiled. It took a small amount of tweaking but everything compiled fine.
When I run the application via IIS (http://localhost/myapp) I get the following error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
The relevant part of the Web.config is:
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
...
The error is highlighting the script ResourceHandler
I have done some Googling but cannot find a solution to this problem. Any ideas?
The first thing that pops out at me is that the ScriptResourceHandler block, as well as the others that you've listed, are referencing v3.5 of System.Web.Extensions, where it should be referencing v4 for a .NET 4 application.
(Not all of the .NET 4 framework assemblies have been updated to a v4 version number but this one does.)
It looks like you're working with the the old v3.5 web.config. If so, you may try making a backup of web.config (of course), adding a new, default web.config to the web app, and then adding in any custom settings (appSettings, connectionStrings, etc). That's probably the fastest way to get a correct web.config without having to manually modify each entry, update attribute names, etc.
Also, you may or may not be aware that many IIS settings have been moved into the system.webServer section in web.config in 7.x that were in other sections for IIS6/v3.5. If you start with VS's default v4 web.config, it won't be an issue.

Resources