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.
Related
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.
When I execute my .NET MVC website from within visual studio, the url points to
http://localhost:61453/ (I have set this port number).
Now I need to publish this to a different local server, whose IP is 172.21.1.83, so that users can access the website by typing www.mysite.com as the URL.
The site needs to be deployed on IIS 7. How do I achieve this? I tried using the 'Publish' option, but it asks me to enter Server, Site name and destination url. So as far as I understand, I should be entering these:
Server: 172.81.21.83
SItename: www.mysite.com
site url: The director where my deployment artefact will be located.
Is this correct? Also, once I create the deployment artefact, do I just open up IIS manager and follow the prompts to host it?
I tried some online steps regarding this, but I am unable to figure it out.
Open IIS manager on IIS server -> expand your server -> right click sites -> select Add website. Choose your host name, port, application pool and select directory of source files(Content directory - Physical path). Then you can click publish in visual studio. Choose filesystem as publish method and publish your project to local drive. Then just copy content of published folder on your drive to folder you have selected when creating IIS site(directory of source files mentioned here).
There are other options how to get your site from VS to IIS. You can send files directly via FTP My favourite is web deploy, where you create config file on IIS, load it to your project in VS and just click publish.
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?
I have a hosting running windows, lets say the root domain is xxx.com. On xxx.com there should be website running on php (since IIS can run PHP, right?) or asp.net. I really dont know yet.
I am now responsible of making a asp.net mvc app, which should be running only inside a folder like xxx.com/myaspapp.
I've tried to publish the app straight to the folder via visual studio and it fails with an error:
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: 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.
What is a solution for this? Is this scenario even possible?
Thank you.
WebDeploy can create a virtual application under an IIS site automatically. Check it out:
THE ANATOMY OF A WEBDEPLOY PACKAGE
It is simple to host an application in a sub folder. Follow the below steps.
Create a folder (myaspapp) under the root site path.
Open IIS Manager (inetmgr) and expand till the new folder.
Right the newly created folder and click on Convert to Application.
Deploy/Upload the application files directly to this folder.
Now you will be able to access the site from the sub folder.
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).