when I click on Browse &;80(http) i got this screen - asp.net

when I clicked on Browse *;80(http) I got this screen in IIS..what could wrong? please give me solution.

Try installing the ASP.Net Frameworks.
Also check whether you have configured web config file in a proper manner.
All frameworks are very important as far as the configuration goes.
Hope this helps!!

The issue you are running into is a common problem for developers since they start developing on their Desktop or their Documents folder without realizing that only they have access to them. In other words those folders only have ACL's for you. This works ok when you use Visual Studio since they run the process as your identity which makes it all work, however when you use a real server, such as IIS that runs as a service it will no longer run the process as your identity but some service account which will NOT have access to your directory.
You will need to add ACLs for IIS to be able to read the files (IIS_IUSRS or the AppPool Identity like IIS APPPOOL\DefaultAppPool, depending on the settings of your apppool), or move it to a folder that has enough access such as \inetpub\wwwroot\

Related

Using LocalHost IIS over Express; custom based

I have been in the situation where my rest of the team is using IIS express, where as I feel more comfortable with proper IIS.
I know I can change project file and direct to the IIS. However it comes with the limitation.
I cannot push project file changes to git because it will affect others.
Is there any nicest way to handle such thing so that I use IIS where as the rest is still on IISExpress?
In your project's properties (right click in solution explorer, properties), go to the 'Web' tab and uncheck"Apply server settings to all users (store in project file)", this way the changes will be kept in the user settings projectName.csproj.user file
Presuming you don't have a bunch of url-based dependencies the solution is easy -- just configure IIS manually to point at the folder on a different port than IIS.
Debugging is a little trickier to kick off -- you will need to run Visual Studio as administrator and then attach to the IIS process.

Classic ASP suddenly giving me permissions (401.3) error

Background: I support a classic ASP environment. I have a development setup locally on my machine as part of that support. I am running IIS7.
To access my environment, I use "http://localhost:99999/" (port # faked for privacy purposes). I have not had a problem with this -- until today.
I built an application that is intended to run in this environment. The app is ASP.NET v.4.0 (for sake of example, I'll say it's called "http://localhost:99999/DotNetApp/"). Of course, in order to run this, I had to set up my environment application pool to support it (which it now does).
Problem: after configuring this, I am now getting:
Server Error in '/' Application.
Access is denied.
Description: An error occurred while accessing the resources required to serve this request. You might not have permission to view the requested resources.
Error message 401.3: You do not have permission to view this directory or page using the credentials you supplied (access denied due to Access Control Lists). Ask the Web server's administrator to give you access to '[filepath]\SourceFiles'.
I did NOT get this before I set my IIS configuration. Why am I getting this now?
Note: this ONLY happens with "http://localhost:99999/"; this does NOT happen if I try "http://localhost:99999/default.asp" (the page comes up with no problem).
Anyone have any insight?
Thanks in advance . . .
Edit: Additional symptoms: I tried playing with the application pool settings. The problem goes away if I change the .NET Framework version to either 2.0.50727 or to "No Managed Code." Changing it to 4.0.31319 breaks it. Of course, if I use any of the other two versions, my ASP.NET app won't run.
Edit #2: This problem occurs on ALL links that go to a folder or directory (e.g. "http://localhost:99999/somefolder/"), not just the web root.
Edit #3: I have a workaround: set "http://localhost:99999/" and "http://localhost:99999/DotNetApp/" in separate application pools. The first runs in .NET 2.0, while the latter runs .NET 4.0. (I'll post this as an answer once my 8 hour limit is up.) Probably not the best answer -- I'd prefer something that isn't as much of a kludge -- but for the time being, it'll get the job done. However, if anyone has a solution that enables me to run everything in the same app pool, by all means, post away!
You probably must specify "default.asp" as allowed in your "Default Document" settings in IIS7
EDIT: Check if ASP has been installed: Control Panel -> Programs and features -> Windows Features -> Internet Information Services -> Www services ->Application Development Features-> ASP
EDIT Final solution: The IUSR account is missing from the folder the website is in.
Set the default page for your site in IIS.
Try to set permission "Everyone" for directory "[filepath]\SourceFiles/" or/and "Allow" for other user names and groups in folder properties.

Newbie Trying To Deploy Asp.Net Website

I'm basically wondering what the best way to deploy an Asp.Net Web Site is, mostly from the point of view of security. Right now, I'm trying to publish the website using Visual Studio 2010. Could someone direct me to a good tutorial on how to do this securely? For example, can it be done over an encrypted connection via Visual Studio? Is it necessary to install any software on the server to do this? Should I use a different program to open up an SSL (TLS) connection first, and if so, which program (does it come standard with windows)?
The server is running Windows Server 2008. Development is on Vista.
Many thanks in advance for any direction in this matter!
Andrew
I would publish the site to your local machine and file copy the files across to your test/production environment. As a rule we don't publish sites straight from VS to test or production.
For example you don't want to accidentally push things straight from dev into a live environment do you?
As far as the file transfer security goes you could use SFTP.
Note: First thing is to check with the owner of the server, as they often will provide you an FTP connection and will take care of configuring IIS.
If you want to add security, make a keyfile and sign your assemblies and consider running Dotfuscator on your dlls, the community edition is included in Visual Studio. Here is an earlier question where I've put more info on Dotfuscator.
If you have to do the deployment yourself, here's a few things to consider.
XCopy (easy)
MSI (have to create a setup program, you can do this easily in Visual Studio)
There is no security advantage in deploying using Visual Studio, but you can use Visual Studio to create a small setup program. One thing you want to make sure for security is DO NOT deploy any .cs files. Prepare your files, you should compile in Release mode, make sure debug is not enabled in your config file, keep your bin and it's dll, also the aspx, asmx, ascx, svc, css, js, and config files.
XCopy: Install a small FTP server, or use one your company alreayd has, this will allow you to get your files once you are logged into the target machine. You should be able to get an administrator account for the target machine, just ask the sysadmin of the domain, then log on using remote desktop, got to your ftp site, and download your files. Open IIS on the target machine, create a virtual directory and a pool. Copy your files to the location, configure your connection string to your DB if you use one, then test your website.
MSI: same process as above, except the setup will create the virtual directory and pool for you.
Here is extra info on best practices from the official ASP.Net website.
If you have some control on the server (e.g. to configure IIS7), you might want to look into Microsoft Web Deploy (new product just been released):
http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx
Haven't tried it myself, but looks quite slick and it apparently encrypts the data being copied up, so might suit you.

Best place for ASP.NET web application logs

What is the recommended folder to write the web application log files?
c:\inetpub\wwwroot\Logs, App_Data folder... ?
I prefer App_Data which is always writable by design and closed to access from the browser by ASP.NET filtering module.
You should consider keeping your logs on a separate drive to the one that contains your Windows installation. This is because it is possible for your log files eventually to use all the space on your system drive, at which point your server will stop responding - keeping logs on a separate drive avoids this issue.
There is no standard location for application logs. Use what you and your team agree on.
IIS 6 logs normally live in %WINDIR%\Logs.
IIS 7 seems to default to %SystemDrive%\inetpub\logs\LogFiles.
You may need to give special permissions to that folder , so make sure (for security reasons) it resides outside the web application folder
This really depends on you where you want it to store. i will recommend you to use elmah
(Error Logging Modules and Handlers for ASP.NET) which gives you flexibility to handle logs
Chetan
http://chetanwarade.wordpress.com/

Write to file not working after hosting (publishing the web application) ASP.Net

Writing to a file is not working after hosting the web application, whereas they were working while developing and testing in my localhost on debug mode. What could be the problem in writing to a file after hosting? Is there any special permission that should be given to the folders/file?
Without knowing the OS version or the code you're trying to use, I'd say the most likely culprit is permissions. The ASP.NET user (which varies based on version of Windows) needs write access to the folder you're trying to write to. This is likely not enabled by your host.
Yes, you will need read, write, and modify permissions to the directory you wish to write to. You need to ensure that the account under which ASP.NET is running has those rights set up.

Resources