Run ASP.NET application in a sub-folder of localhost - asp.net-mvc

Is it possible to run ASP.NET application in a subfolder of localhost ? E.g. "localhost:61778/subfolder/" instead of "localhost:61778/"?
I will publish my web application into sub-folder on real host like "www.mysite.com/subfolder/". I want to test that all patches will be builds correctly and sub-folder will be used (I need to save and restore some files).
Another question is How to get website directory with a sub-folder like "www.mysite.com/subfolder/" where a website is deployed?

You can install IIS on your local machine and create an application over IIS (localhost/ApplicationName).

Related

how to deploy asp.net website in intranet- Copy paste folders

I am new to web developing and some how managed to create one web page with SQL database. Now I would like to deploy my website in localhost server by that users who are having access to that server can use the website. I did some search and deployed website in development computer by creating an application in IIS server inetmgr however I don't know how to deploy in production system. Please guide me with possible and effective method by that I can proceed further.Deployment to test
Right-click your project, select Publish.
Create a profile name
On Connection tab, set the Deploy method to File System
Put the file location you want to publish to
On Settings tab, put in the database connection strings if necessary
Save
Right-click project, Publish
Go to the place where your site was published.
Copy all files in that folder and paste it in the IIS web server's virtual directory where your app will be located.

How to setup a virtual directory for local host test run?

I have an ASP.net MVC 5 aplication with VS2017.
I would like to load some pictures from a network path (the pictures should not be included to the project folder structure).
I know how to add a virtual directory in IIS on my server where the application is finally running. But I dont know how to setup the same on my local computer.
On the server I can setup an Alias and a physical path.
But in my project in VS2017(properties/web) I can only press the button "create virtual directory" next to project url "http://localhost:51138/".
Can maybe someone explain how to setup an virtual directory on localhost for testing? Thank you so much.
You are using the Visual Studio Development Server which does not allow virtual directories. You can do what you want with a local copy of IIS, creating a website that points to your development folder, and creating the virtual directory you want in that website.
Install a local copy of IIS. This is available to you in the
Professional version of Windows.
Open IIS Manager, create a new website, and set the Physical
Path to your development folder.
Add a binding for this website with the Host name set to a domain name you want to use for
testing. I generally use ".loc" as the TLD. For example, the
production website domain of "mywebservice.com" would be
"mywebservice.loc". Use port 80 in the binding.
Modify your local hosts file at
C:\Windows\System32\drivers\etc\hosts to include this line. Replace
"mywebservice.loc" with whatever domain you chose to use above mywebservice.loc 127.0.0.1
In your VS project properties, set Web-->Servers to Use Custom Web Server and
set the Server Url to mywebservice.loc or whatever domain you chose above.
Now you can add a virtual directory just as you do in production.
I do this for all my website development primarily because nothing will happen in production that does not happen locally. You can even test using real SSL certificates this way.
Just create a folder in the directory of your project to mimic what will be a virtual directory and then copy some test files there.
For example, create a documents directory in your project directory. So the referenced path in your project will be something like ~/documents/somefile.pdf
The server's virtual directory documents can then point to some some other network location.

Can we host Asp.Net Core application as like Web Site Project in IIS?

I would like to deploy my Asp.net Core application with full of code in IIS server.
So I can able to update individual files in production by just copying new versions to the production server(.cs files or any class file.), or by editing the files directly on the production server.
I do not want to deploy my project code as dll. Instead of dll I want to publish my .cs files same like Web Site Projects.
No, we can't do that because IIS acts as proxy for ASP.Net Core

Cannot find App_Start foler or update bundle config of ASP.NET MVC website in cpanel in live server

I am deploying an ASP.NET mvc application in this hosting smarterasp.net. Currently my hosting plan is 60 days free trial. I got access to cPanel. Now I already successfully deployed my website on live server. But I want to change the Bundle config class, because I added new CSS files and want to reference it.
So I opened file manager from cpanel and find App_Data folder where bundle config class exists. But there is no App_Start folder in file manager as you can see below.
How can I edit my bundle config class? My hosting is Smarterasp. This is my first time of deploying an asp.net website on live server.
You should note that the whole asp.net mvc web app gets compiled into a single dll. If you need to make an update, you should recompile and re-upload everything including the (web app name).dll file in your bin folder. If you just change code on the server, it won't reflect on the site.
Other than that, please provide some more info. Do you see the app_start folder on your local dev machine? What happens if you re-upload it?

IIS and MVC show folder structure

i have tried to deploy an mvc application in an windows server 2008 with iis7.
i have copied all the content to the inetpub/wwwroot folder
i changed the framework version of the application pool to v4.0
i ran the aspnet_regiis.exe
the project was properly released because i have deploy succesfully to my desktop dev (iis) and one arvixe hosting, but i cant make it work on the server.
but i can only see the folder structure, i tried creating virtual directorys and everything, but nothing works. am i missing something.
thx

Resources