Web hosting forums || get your web hosting related questions answered https://www.hostasp.net/forums/tags/visual-studio-publishing.html 2024-04-29T06:07:54+00:00 Joomla! - Open Source Content Management How to: One-Click Web publishing or Deploying your Website using Visual Studio 2011-11-22T02:58:13+00:00 2011-11-22T02:58:13+00:00 https://www.hostasp.net/forums/question/how-to-one-click-web-publishing-or-deploying-your-website-using-visual-studio.html Jacob [b]In this Topic we will see how to deploy a Sample MVC Web Application using Visual Studio 2010 One-click publish feature:[/b] After you have created an ASP.NET Web application project or an ASP.NET Web site project in Visual Studio 2010, you typically deploy the project to a Web server for others to access your application. Deployment typically involves more than just copying the application's files from one server to another. You might also have to perform additional tasks, such as the following: [list] Changing Web.config file settings that must be different in the destination environment, such as settings for debugging, or database connection strings. You could use File Manager to modify your web.config. Propagating data or data structures in databases that are used by the Web application. You would use SQL Management studio from your machine to connect to remote SQL DB server. Configuring Website IIS settings on the HostASP server, such as the application pool, the authentication method, whether directory browsing is allowed, and error handling. You will be using WebsitePanel control panel to perform this IIS settings. Installing security certificates. If you would need SSL you must take support from HostASP Setting values in the registry of the destination computer. - Is not allowed with HostASP Shared hosting Installing application assemblies in the global assembly cache (GAC) on the destination computer. - Is not allowed with HostASP Shared hosting [/list] An extension to Microsoft Internet Information Services (IIS) that is named Web Deploy can automate most deployment tasks. Visual Studio provides tools that work with Web Deploy to make it easier for you to deploy a Web application project. [quote]One-click publish - Web Application Project[/quote] [b]Following steps will show you how to deploy a Web Application Project using One-click publish feature[/b] [list=1] Creating MS SQL databases. Setting up Web publishing environment. Configuring your IIS Website application pool. Creating new Publish profile in Visual Studio. Setting up Publish Web in Visual Studio Setting up Publish SQL in Visual Studio Publishing your Website. [/list] [b]Step 1. Creating MS SQL databases. (WebsitePanel) [/b] If your web application project uses MS SQL database then you would need to create a new database on your hosting account. To create new database follow the steps here. < [url=http://www.hostasp.net/forum/managing-databases/57-creating-ms-sql-server-databases-and-database-users.html]Creating New databases[/url] > . You will use this information to rebuild publishing XML in the following step. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-ms-sql-server-db.PNG[/img] [b]Step 2. Setting up Web publishing environment. (WebsitePanel)[/b] Login to your Web hosting panel and select your Website, you would see Web Publish properties Tab, now enabling this will create a new web publishing account. After your account is created you will see a link to rebuild publishing XML- click on the link and configure your database for use. Now after reconfigure is done, you will be able to download the updated [b]Publishing XML for your Reference[/b]. This XML contains your Service URL, SQL server name, and other related information for you Visual studio publishing. (If you're using WebMatrix you could use this XML to directly import to WebMatrix IDE). ([b]Download your publishing XML to your client machine[/b]) [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/dotnet-webpublishing-settings.PNG[/img] [b]Step 3. Configuring your IIS Website application pool. (WebsitePanel)[/b] This is a vital part you would need to really look into it and set it up correctly. You would choose appropriate Application pool depending upon your web application targeted framework, if you have app built on framework .NET 4.0 then your choice here would be 4.0. [i][b]Please note that for MVC application you would need to select Integrated Pipeline.[/b] for rest of app you would select Classic pool which are just displayed as 2.0 / 4.0.[/i] Still the version depends on your targeted framework. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/dotnet-application-pool-settings.PNG[/img] [b]Step 4. Creating new Publish profile in Visual Studio. (Visual Studio 2010)[/b] Now that we have configured our Web publishing setup on our hosting space. Let see how to setup Visual studio for Web deploy. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-create-web-publish-profile-menu.PNG[/img] Open your Web project using Visual studio 2010, on menu bar you would see [b]Publish:[/b] menu item. You could create as many profiles you want using this, let us see how to create a new profile now. Click on new profile option. This will launch profile screen as shown below. [i]Open your Publishing XML and have it ready reference. [/i] [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publishing-profilesetup.PNG[/img] a) Name your profile b) Select publishing method as "Web Deploy" [b]c) Find publishUrl attribute in downloaded XML file and copy its value to Service URL field. (suffix with msdeploy.axd - refer figure above)[/b] d) On Site/application field type your domain name (or) copy msdeploySite attribute value from XML file. e) Leave untrusted certificate field checked. f) Configure user name and password that your created in Web publishing tab on your hosting space ( you could refer userName and userPWD attribute from your downloaded publishing XML). Click on Save button to save your profile. (See top right corner of the profile window) Ok, we just saw how we will have to setup the publish profile. The next 2 steps 5 & 6 will be about how you want to make this publish process work for your website contents and MS SQL db. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publishing-menu.PNG[/img] [b]Step 5. Setting up Publish Web in Visual Studio[/b] Here in this screen you would determine what contents are to be deployed on your remote website. [b]We will NOT concentrate on Packing-part instead we’re going to deploy directly to your hosting space. [/b]As you see on the image, you can determine whether only runtime components is required ( advisable for release version / production environment) (or) all files of your project and then you can also choose whether to exclude app_data folder and so on. [i]Do not forget to “check” Include all databases configured in Package / Publish SQL tab if you’re using SQL server database for your web application project.[/i] [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publish-web.PNG[/img] [b]Step 6. Setting up Publish SQL in Visual Studio[/b] You will be using this Publish SQL screen for setting up DB configuration. As you see in this screen, you will select the databases entries you want publish, you could also import directly from your web.config. Then you will need to configure your remote database connectivity for publishing your SQL and data. [i]Refer to your downloaded Publish XML content for destination SQL server name, your database and its credentials.[/i] The connection string as you see on the image will be generated, after successful configuration of destination database setup. (You could copy this connection string and update your Web.config HostASP on hosting space.) Further down in this screen you could see scripting options that determine what to publish to remote DB (Schema / Data / both). [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publish-SQL.PNG[/img] To setup HostASP remote database connection string, click on "..." button on Destination Database Information. This will launch configuration setup for remote database as shown below. You would refer to downloaded Publish XML to configure this part. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-database-connectionstring.PNG[/img] [b]Step 7. Publishing your Website.[/b] Hurray, you're done with required setup for publishing your Web project. Now it is time to publish your website. On your Visual Studio menu bar select your publishing profile and click on “Publish web” (or) alternatively you could right click on your project name and select “Publish” action. This will copy all your web project contents, SQL database information as per configured setup in Visual studio. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publishing.PNG[/img] After you get your web project successfully published, you would need to update your connection string in web.config on your hosting space. You could see the connection string that you need in Step 6. above. This will make your Website point to your HostASP database. You can now launch your sample MVC website that you just published. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-mvc-application.PNG[/img] Good luck, if you have any queries contact HostASP support. [b]In this Topic we will see how to deploy a Sample MVC Web Application using Visual Studio 2010 One-click publish feature:[/b] After you have created an ASP.NET Web application project or an ASP.NET Web site project in Visual Studio 2010, you typically deploy the project to a Web server for others to access your application. Deployment typically involves more than just copying the application's files from one server to another. You might also have to perform additional tasks, such as the following: [list] Changing Web.config file settings that must be different in the destination environment, such as settings for debugging, or database connection strings. You could use File Manager to modify your web.config. Propagating data or data structures in databases that are used by the Web application. You would use SQL Management studio from your machine to connect to remote SQL DB server. Configuring Website IIS settings on the HostASP server, such as the application pool, the authentication method, whether directory browsing is allowed, and error handling. You will be using WebsitePanel control panel to perform this IIS settings. Installing security certificates. If you would need SSL you must take support from HostASP Setting values in the registry of the destination computer. - Is not allowed with HostASP Shared hosting Installing application assemblies in the global assembly cache (GAC) on the destination computer. - Is not allowed with HostASP Shared hosting [/list] An extension to Microsoft Internet Information Services (IIS) that is named Web Deploy can automate most deployment tasks. Visual Studio provides tools that work with Web Deploy to make it easier for you to deploy a Web application project. [quote]One-click publish - Web Application Project[/quote] [b]Following steps will show you how to deploy a Web Application Project using One-click publish feature[/b] [list=1] Creating MS SQL databases. Setting up Web publishing environment. Configuring your IIS Website application pool. Creating new Publish profile in Visual Studio. Setting up Publish Web in Visual Studio Setting up Publish SQL in Visual Studio Publishing your Website. [/list] [b]Step 1. Creating MS SQL databases. (WebsitePanel) [/b] If your web application project uses MS SQL database then you would need to create a new database on your hosting account. To create new database follow the steps here. < [url=http://www.hostasp.net/forum/managing-databases/57-creating-ms-sql-server-databases-and-database-users.html]Creating New databases[/url] > . You will use this information to rebuild publishing XML in the following step. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-ms-sql-server-db.PNG[/img] [b]Step 2. Setting up Web publishing environment. (WebsitePanel)[/b] Login to your Web hosting panel and select your Website, you would see Web Publish properties Tab, now enabling this will create a new web publishing account. After your account is created you will see a link to rebuild publishing XML- click on the link and configure your database for use. Now after reconfigure is done, you will be able to download the updated [b]Publishing XML for your Reference[/b]. This XML contains your Service URL, SQL server name, and other related information for you Visual studio publishing. (If you're using WebMatrix you could use this XML to directly import to WebMatrix IDE). ([b]Download your publishing XML to your client machine[/b]) [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/dotnet-webpublishing-settings.PNG[/img] [b]Step 3. Configuring your IIS Website application pool. (WebsitePanel)[/b] This is a vital part you would need to really look into it and set it up correctly. You would choose appropriate Application pool depending upon your web application targeted framework, if you have app built on framework .NET 4.0 then your choice here would be 4.0. [i][b]Please note that for MVC application you would need to select Integrated Pipeline.[/b] for rest of app you would select Classic pool which are just displayed as 2.0 / 4.0.[/i] Still the version depends on your targeted framework. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/dotnet-application-pool-settings.PNG[/img] [b]Step 4. Creating new Publish profile in Visual Studio. (Visual Studio 2010)[/b] Now that we have configured our Web publishing setup on our hosting space. Let see how to setup Visual studio for Web deploy. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-create-web-publish-profile-menu.PNG[/img] Open your Web project using Visual studio 2010, on menu bar you would see [b]Publish:[/b] menu item. You could create as many profiles you want using this, let us see how to create a new profile now. Click on new profile option. This will launch profile screen as shown below. [i]Open your Publishing XML and have it ready reference. [/i] [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publishing-profilesetup.PNG[/img] a) Name your profile b) Select publishing method as "Web Deploy" [b]c) Find publishUrl attribute in downloaded XML file and copy its value to Service URL field. (suffix with msdeploy.axd - refer figure above)[/b] d) On Site/application field type your domain name (or) copy msdeploySite attribute value from XML file. e) Leave untrusted certificate field checked. f) Configure user name and password that your created in Web publishing tab on your hosting space ( you could refer userName and userPWD attribute from your downloaded publishing XML). Click on Save button to save your profile. (See top right corner of the profile window) Ok, we just saw how we will have to setup the publish profile. The next 2 steps 5 & 6 will be about how you want to make this publish process work for your website contents and MS SQL db. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publishing-menu.PNG[/img] [b]Step 5. Setting up Publish Web in Visual Studio[/b] Here in this screen you would determine what contents are to be deployed on your remote website. [b]We will NOT concentrate on Packing-part instead we’re going to deploy directly to your hosting space. [/b]As you see on the image, you can determine whether only runtime components is required ( advisable for release version / production environment) (or) all files of your project and then you can also choose whether to exclude app_data folder and so on. [i]Do not forget to “check” Include all databases configured in Package / Publish SQL tab if you’re using SQL server database for your web application project.[/i] [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publish-web.PNG[/img] [b]Step 6. Setting up Publish SQL in Visual Studio[/b] You will be using this Publish SQL screen for setting up DB configuration. As you see in this screen, you will select the databases entries you want publish, you could also import directly from your web.config. Then you will need to configure your remote database connectivity for publishing your SQL and data. [i]Refer to your downloaded Publish XML content for destination SQL server name, your database and its credentials.[/i] The connection string as you see on the image will be generated, after successful configuration of destination database setup. (You could copy this connection string and update your Web.config HostASP on hosting space.) Further down in this screen you could see scripting options that determine what to publish to remote DB (Schema / Data / both). [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publish-SQL.PNG[/img] To setup HostASP remote database connection string, click on "..." button on Destination Database Information. This will launch configuration setup for remote database as shown below. You would refer to downloaded Publish XML to configure this part. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-database-connectionstring.PNG[/img] [b]Step 7. Publishing your Website.[/b] Hurray, you're done with required setup for publishing your Web project. Now it is time to publish your website. On your Visual Studio menu bar select your publishing profile and click on “Publish web” (or) alternatively you could right click on your project name and select “Publish” action. This will copy all your web project contents, SQL database information as per configured setup in Visual studio. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-publishing.PNG[/img] After you get your web project successfully published, you would need to update your connection string in web.config on your hosting space. You could see the connection string that you need in Step 6. above. This will make your Website point to your HostASP database. You can now launch your sample MVC website that you just published. [img]http://www.hostasp.net/articles/images/visual-studio-remote-deployment/vs-2010-mvc-application.PNG[/img] Good luck, if you have any queries contact HostASP support. ftp and publishing my MS visual studio website. What are the location details 2012-05-26T06:26:51+00:00 2012-05-26T06:26:51+00:00 https://www.hostasp.net/forums/question/ftp-and-publishing-my-ms-visual-studio-website-what-are-the-location-details.html Donald Burrows I don't know how to FTP or publish my MS visual studio built website to my host folders. I know my nameservers names, I can see I have a folder called wesume.net and folders under it called things like wwwroot etc... So when visual studio asks for my target location WHAT DO I TYPE????? I don't know how to FTP or publish my MS visual studio built website to my host folders. I know my nameservers names, I can see I have a folder called wesume.net and folders under it called things like wwwroot etc... So when visual studio asks for my target location WHAT DO I TYPE?????