Windows Server 2008 publishing ASP.NET - asp.net

I installed Windows 2008 wo/ Hyper-V to my server. I configured IIS 7 and start publishing HTML pages successfully. But when I want to publish (ASP.NET/C#) web site, I faced with an error which is;
' It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.'
Error line is; <authentication mode="Forms"> . I configured IIS server and enables Forms authentication at authentication form, but still I cannot reach my web site. What can be the problem?
Thank you,
Jack Smith.

Related

web config error running asp.net app on Azure App Service

I am very new to Azure and have deployed a .net application to an Azure web Service over FTP and am getting the below error in the web config at the top line of the section below:
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.
<authentication mode="Forms">
<forms loginUrl="~/Account/Logout" defaultUrl="~/Home" timeout="120" slidingExpiration="true"/>
</authentication>
I have searched online and problem seems to generally come when there are multiple web configs, which isnt the case here. Is there something specific I need to configure in Azure? The application runs fine on local web server.
For additional information the application is in a sub directory in the root and I have added a virtual application in the Azure app portal for the root directory of the application.

IIS and SQL Server Windows authentication in a django application

I am trying to run a django website which connects to a SQL Server, using IIS with Windows authentication.
IIS server and SQL server are on different machines under the same domain i.e., iis_machine.example.com and sql_machine.example.com
What I'm trying to achieve:
Impersonate the remote user accessing the django website hosted on
IIS, so his Windows credentials are passed to SQL Server for
authentication.
What I tried so far:
Added this to my web.config file for impersonation
<system.web>
<identity impersonate="true" />
</system.web>
Enabled Windows authentication and set up Application Pool (django_web) for django website as shown below
This is what my Authentication for django website looks like in IIS
This is what my Application Pool for django website looks like in IIS
Added IIS APPPOOL\django_web to SQL Server Security\Logins
Result:
When I access the django website, IIS prompts the user for his
Windows credentials and I can successfully login
If user tries to access SQL Server after logging in
Case a. IIS, SQL Server are on the different machines: SQL server authentication fails with
"Login failed for user 'domain\MACHINENAME$'
Case b. IIS, SQL Server are on the same machine, SQL server authentication is successful but authentication credentials used are IIS APPPOOL\django_web not domain\remote_user
I understand that there is some Kerberos trickery involved with this setup. Unfortunately, I'm only a programmer and not very familiar with how Kerberos works. If someone experienced in this domain, could shed some light on how this setup would work, that'd be really appreciated. Thanks!
I am using:
IIS 10 SQL
Server 2014
django 2.0.7
Python 3.6.5
Windows 8/10

Server Error in '/' Application asp website

When i visit my website i see this error. Id there somthing i have to do from my end or the hosting porovider has to do? i only have access to the Plesk hosting pannel
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: C:\Inetpub\vhosts\wincarsassociation.com\httpdocs\web.config Line: 23
Version Information: Microsoft .NET Framework Version:2.0.50727.8009; ASP.NET Version:2.0.50727.8015
From https://stackoverflow.com/a/7530832/59996
This typically happens when you have an attribute of
targetFramework="4.0" in the web.config but the App Pool is set to run
ASP.NET 2.0
The top answer to this question has details of how to configure an AppPool
How to add ASP.NET 4.0 as Application Pool on IIS 7, Windows 7
Is there a place in the Plesk interface where you can change your AppPool from v2.0 to v4.0?
(Try looking under Home > Tools & Settings > IIS application pool)

WCF IIS Error 403

I am reading the book WCF 4.0 Multi-tier Services Development and tried implementing a simple Hello World with WCF using IIS.
I have a HelloWorldService project and a HostDevServer project (Startup Project). I should see a directory listening with two files but instead I get the next error message:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
What I have done:
Enabled Directory Browsing in IIS manager
Checked if I had Default Documents, they were present.
Run command: appcmd set config /section:system.webServer/directoryBrowse /enabled:true
In the about screen in IIS it says version 7.5 and in the browser it says "IIS 8.0 Detailed error ...". I don't know if this has something to do with the problem.
I use Visual Studio 2013 for development. Web.config below:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
Does anyone know how to solve this problem?
I suspect you try to host the WCF as it was hosted with the self-host - under an extensionless uri.
This won't work. WCF services are hosted under *.svc activators. The extension informs IIS that it should find a proper host factory and create the service.
I added the website to the IIS manager and now it is working. I did need to edit permissions to acces the files but now i can acces the page without problems.
Should have read further in the book because they also explain about *.svc activators later.

asp.net website doesn't run on server

I'm getting a runtime error when I try to access my asp.net website on a server. It works fine from my computer when I test it but once I upload it to my host, the runtime error appears.
I get this message:
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
My webhost is godaddy. The server is indeed windows and according to their tech support they have all the frameworks installed and up to date (I'd imagine this anyway from such a large host).
Basically they say it's an error on my end but I have no clue what I'm doing wrong. I made the website with Visual Studio 2010. I'm new to this technology.

Resources