ASP.NET webapplication deployment - with domain / server name access - asp.net

I have deployed my ASP.NET web application on IIS (windows 2008 server). I have created a virtual directory (named TestApp) and all the users on local area network are accessing it with the following URL.
http://"SERVERNAME"/TestApp/Default.aspx
My client wants that, it should be accessed as following URL
http://"SERVERNAME"/Default.aspx
There is single application deployed on the server.
Could you let me know how can i implement this thing??

Instead of adding a virtual directory on the existing site, you need to add a new web site
Create a Web Site (IIS 7)

In fact, it's fairly simple.
Remove your current app, including all files and settings in IIS (i.e.: delete everything).
Run the deploy wizard again, BUT be carefull of the path that it's given to your application: by default, you should see "http://SERVERNAME/TestApp/". Remove "TestApp". The wizard will show you a warning message, just continue.
Finish the wizard as usual, and voila!
I did this 2 or 3 times yet.

Related

Support with hosting an ASP.NET application from my PC at work using IIS Express

I'm fairly new to developing with ASP.NET and in general. I have created a simple data-driven web application that will be used to display images the colors of which will be changed depending on certain criteria. I used Visual Studio 2019 to create it. When I test/run it from within VS 2019 using the "play" button, it runs perfectly and the page opens in my browser just as you would expect.
My issue is that I'm trying to deploy it to the IIS and host it from my machine here at work, so others can access the pages. I have published the application to a local file on my C:\ drive. I then open up IIS Manager and create the website by pointing to that local file. Now, when I choose to browse that site from the IIS manager, at first I was getting an error saying that access is denied.
Then I followed the instructions to configure the security on that local file folder to allow IIS_USRS to access the file, but when I run it, I just get a page that tries to load indefinitely.
What am I doing wrong? If I point the IIS Manager to the files after saving them to a location on my company's network, I again get the access is denied error.
Do I understand it correctly that IIS needs permission to access the files? If so, how do I configure it that way other than what I already tried? If I need to provide further information, please let me know. Thanks so much for your support.

How can I get Visual Studio to automatically attach debugger to web Site not Application?

I have a web application required to run as a Web Site (root application). This is due to it being a multi tenant application that uses the urls sub domain prefix to know which client is accessing it. I create the site in IIS 10 setting the physical path to my Visual Studio 2017 .NET 4.5 MVC application and the site works fine.
I open the web project properties and under Servers choose Local IIS setting and set Project Url to the site I just created in IIS. Visual Studio then forces me to create a Virtual Directory for the Project Url, to save it, which then creates a Web Application under the default web site. You can't set and save the Project Url without being forced to create the virtual directory.
Now when I start debugging Visual Studio attaches to the Web Application not my web site so my breakpoints never get hit. If I manually attach to the w3wp process where the web site is running I can debug. I had this all working fine prior to recently switching to Git causing me to reconfigure things and I can't recall what I did to make it work.
How can I set the Project Url on web properties page without being forced to create a virtual directory? Or how do I make VS automatically attach to the Web Site and not Web App I was forced to create?
This blog might help: How to Debug Your ASP.NET Projects Running Under IIS
If your project is a website and not a web app, then here are the steps to configure it to use IIS when debugging. This assumes you already have IIS set up and hosting your project.
In the solution explorer.
Right-click on your project node and navigate to "Property Pages".
Navigate to "Start Options" item in the left pane.
In the "Server" section make sure "Use custom server" is checked.
In the "Base URL:" field put in the address you have mapped to your project. (Usually the address you put in your hosts file)
I finally discovered that setting the Servers 'Project Url' in the web projects properties page to 'http://localhost/' does not force you to use the 'Create Virtual Directory' to save the changes. You can't even change the default port here without being forced to create a virtual directory.

Routing issues after publish asp.net mvc app

I recently developed an asp.net mvc application that want to publish online. I used the Publish option on Visual Studio to do that.
Apparently this is a common task and there are several tutorials about that. However my case has a different detail that I believe is not allowing me to run the app successfully.
So the thing is:
I have a Wordpress site successfully running at www.somedomain.com
I want my asp.net application to run at www.somedomain.com/myapp
This is what I have done so far:
Uploaded all my app files to httpdocs/myapp folder on the server;
Configured a virtual directory on httpdocs/myapp folder on the server;
Imported the database from my local computer to the remote server;
Changed the connection strings on web.config to point to the database on the remote server;
After this, when I try to access on the browser to www.somedomain.com/myapp I can see that it redirects me to www.somedomain.com/myapp/Account/Login?ReturnUrl=%2Fmyapp%2F but shows the 404 error (Page not found) with the layout of my Wordpress site. So it looks like it is running the Wordpress site, instead of the asp.net app on that folder.
are you using IIS?
you need to create an application instead of a virtual directory
otherwise it will not treat the sub folder as an application and will follow parent folder’s web.config and other settings

Deploying WCF webservice to IIS

I'm trying to deploy a wcf web service to IIS 7.5. Is there anything special I need to do in order to make this work. I keep getting 404 error when I try and run the web service. I can't seem to pull up the wsdl file either.
These are the steps I've taken
Right-clicked on web service project and published to local folder
Copied contents of publish to IIS server
Setup a new website that points to folder with webservice files
set binding to match web.config binding (port #)
Is there anything I missed or overlooked. Shouldn't I be able to run that web service from IIS and load up the wsdl file directly on the server. When I test in visual studio, it handles the loading of that host program.
Apparently you have to load the .svc file path which I was not doing.
Just to expand on this a little, since this question got me started but there were a couple of extra steps I had to take:
In VS2012 right click on the web service project and select Publish
Publish to file system by selecting a directory to publish to
Copy the folder contents into a folder on the server
In IIS create a new website, its physical path being where you just copied the published contents to.
Set its app pool appropriately (probably .NET 4.0)
The binding port should be the same as in the web.config as should the name. So if you've been working locally and your web.config reads "http://localhost:12345/MyService" then hostname is "localhost" and the port is 12345
You can then browse to the webservice by right clicking on the website in IIS -> Manage Website -> Browse. Click on your service name.

Configure IIS 6 web application on a personal server

A group of us wrote a .NET web application for our University class and in order to let our prof test with it I am setting it up on my webserver at home. Here is what I have done so far:
I created a new account on my domain, I then granted that account Read, write access to the folder where the app is stored. I have setup an application pool that uses this new account as its identity and created a new site that uses the new application pool.
I initially was receiving the Service unavailable error message, so I realized I had to add my account to the IIS_WPG account. So now I am stuck at the "page cannot be found". The website is pointing to the correct folder (I can see the aspx page list from within the IIS browser) but when browsing the site either in IIS, on a browser on the server or on a browser within my network I keep getting Page cannot be found. The home directory is pointing to default.aspx which is what our app uses.
The app of course works just fine when running from within the IDE, but now that I am trying to get it to work it doesn't want to.
Any thoughts?
Thanks.
you should give error details first.
for now, I suggest you check the 'network service' account's permission.this is the ASP.NET's account.
then publish your site to *.aspx file and *.dll file. to see if there is any errors.
So I found the issue. What I didn't know is that by default, IIS 6 does not turn on support of active server pages and .NET pages in Web Service Extensions. Once I had turned this on the site began to work just fine.

Resources