Deploying VS2010 ASP.Net website on IIS 7.5 - asp.net

I know there are related posts here on this forum and another resources but I got stuck with this and couldn't proceed. Problem is I've done a website with VS2010 when I publish it to a FTP server and navigate to the url address I got an error.
Here are the things that I've done:
I've enabled IIS services and static content
I've revert to parent the staticFile under handler mappings
I've registered the asp.net again in command prompt(the regiis.exe thing)
In IIS manager i've added my website adress under sites, stopped default web site and started mine.
I've added my site to classic.NET AppPool(integrated,and v4.0)
I've enabled the default browsing..
I've done all the advices that generally covered..
Here is my web.config:
<configuration>
<system.webServer>
<directoryBrowse enabled="true" showFlags="Date, Time, Size, Extension" />
<defaultDocument>
<files>
<add value="AnaSayfa.aspx" />
</files>
</defaultDocument>
</system.webServer>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
Where am I making a mistake?

The following post has some answers to this same question.
How do I fix 404.17 error on Win Server 2k8 and IIS7
Hope that helps.
EDIT: I see you've tried most of these...Sorry.

Related

IIS7.5 web.config redirects being ignored

I have the following httpredirect in the web.config which is being ignored. This web.config is on the root of a hybrid webforms and MVC web application. Both locations in the example below are webforms pages.
<configuration>
<system.webServer>
<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Permanent">
<add wildcard="*/foldername/" destination="/anotherfolder/file.aspx" />
</httpRedirect>
</system.webServer>
</configuration>
This is on localhost btw but the httpredirect should work on both the localhost and the live server. What am I doing wrong?
NOTE: There are a lot of instructions on the web pointing to the URL Rewrite IIS module. I can't install this on the live server so that's not an option.
https://www.iis.net/configreference/system.webserver/httpredirect
For anyone in the future. Check Modules are installed from above link.

ASHX handler return 500 Internal server error

I have the ASP.NET 4 asmx web service (IIS 7.5). It works by https. I added ashx handler. It works locally, but do not work at the hosting. Return 500 Internal Server Error. What to do?
I encountered this problem when I changed the application pool in IIS from classic to integrated. I solved it by adding a handler to the system.webServer of the web.config file.
<add verb="*" path="*.ashx" name="ImageFromDB" type="ImageFromDB" />
like this:
<system.webServer>
<handlers>
<add verb="*" path="*.ashx" name="ImageFromDB" type="ImageFromDB" />
</handlers>
</system.webServer>
This added 'ImageFromDB' to the HandlerMappings in IIS.
This link was very helpful in pointing me in the right direction.
ASP.Net will display a 500 if you don't have the customErrors property set to anything or it is set to On.
Add this to the web.config to see what the actual error is:
<customErrors mode="Off" />
Once you know what the actual error is, you can proceed to fix it.

Production issues - disable ASP.NET debugging, restrict access to directory

I deployed my latest web site to production environment, now client found that the following issues on my deployment. and that are to be fixed.
I just need some clarification from you all on the following
disable ASP.NET debugging
I already set compilation debug="false" in the web.config, is there anything that to be done apart from this?
restrict access to directory
any idea on defining access rights for users?
Have you tried this:
<compilation
debug="false"
/>
on your web.config
HOW TO: Disable Debugging for ASP.NET Applications
ScottGu's Blog
this will display the exact error that user gets.
And if your application has an download.upload file into a folder you need to
Share Folder name “YourFileFolder” and add ‘Network Service’ account having read/write permission
Regards
There is a configuration setting in machine.config(only) called:
<configuration>
<system.web>
<deployment retail="true"/>
</system.web>
</configuration>
This parameter will automatically turn off debugging features(tracing,compilation,...).
For your security rights, give only access on your directory to the iis pool user.
To disable Browsing in IIS7 add this to your web.config:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<directoryBrowse enabled="false" />
</system.webServer>
In my case (error:
debugging should be disabled in the web.config file
) i basically turned web.config to :
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
note:I use Visual Studio 2010

best way to secure asp 3.0 site's folder

I have requested to fix login problem on the classic asp site.
Configuration is 2008 server and IIS 7.0
I've found that admin directory of the site has basic authentication, however there is no any NT Accounts for requested loginName.
I don't want to create any Windows account for this site and I know that basic auth is insecure (Site doesn't use ssl).
What is the best way to solve this problem? Is it possible to use asp.net security for asp 3.0 site?
You should use SSL.
Without SSL, ASP.Net WebForms auth is no better than Basic HTTP Auth.
To answer the question, yes; you can set it up in IIS admin.
I think that it is better to use WebForms auth in any case.
It is easier then I thought. I just added login.aspx page and config file to classic asp site and authentication is working.
Just one notice that by default htm and asp pages don't process by asp.net.
It is required to add following node in config.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
And I've found that authorization nodes must be in webserver node in IIS7.
Here is full config in case it will be useful for someone.
<configuration>
<location path="admin">
<system.webServer>
<security>
<authorization>
<add accessType="Deny" users="?" />
</authorization>
</security>
</system.webServer>
</location>
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx">
</forms>
</authentication>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>

how to set start page on hosting server after uploading the asp.net site

i have uploaded my site on hosting server with name www.selectionfurnishing.com
but when i try to open any page i got an error that the site does not exits
when i try www.selectionfurnishing.com/default.aspx then it gives error that the page does not exits (404)
please tell me how can i solve this ....
Thanks
You say it's hosted? I would suggest contacting your hosting provider. I would imagine it's a config issue on their side.
If your server is running IIS7, you should be able to set the start page for your site in your web.config file:
<configuration>
<system.webServer>
<defaultDocument>
<files>
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>

Resources