Tag Archives: Publishing

Publish Web Project to GoDaddy

The web hosting provider I am using is GoDaddy and I chose Windows hosting since some of my ideas include developing web applications using Microsoft technologies.  The following explains how I set up my first web project I am in the process of developing, which was my tracker application.

The first step is to get the web deploy publishing settings for the location you wish to host your web project. In my case I want to host it on a subdomain (which I have already created), but the steps are the same if it is your root domain. You navigate to the subdomain section of where you would like to host your app in GoDaddy’s ‘Websites & Domains’ section.  You then click the ‘Web Deploy Publishing Settings’ link to start the download of your settings file (seen in Figure 1 below).

Step 1 - Download Web DeployPublishing Settings
Figure 1: Download Web Deploy Publishing Settings

The downloaded file will contain a .publishsettings extension with the contents of the file similar to:

<?xml version="1.0"?>
<publishData><publishProfile profileName="tracker.dwcryan.com - Web Deploy" publishMethod="MSDeploy" publishUrl="tracker.dwcryan.com" msdeploySite="tracker.dwcryan.com" userName="dwcryan" destinationAppUrl="http://tracker.dwcryan.com" controlPanelLink="https://p3nwvpweb100.shr.prod.phx3.secureserver.net:8443"/></publishData>

Once you have the settings file you can configure your actual project. With your web project opened in Visual Studio you right click on the project in the Solution Explorer and select Publish.. (or something similar depending on project type) as in Figure 2.

Step 2 Right Click Project In Solution Explorer and select Publish
Figure 2: Right Click Project In Solution Explorer and select Publish

This will present you with the window in Figure 3, where you will select the Import option by left clicking.  In the displayed dialog ‘Import Publish Settings’, also displayed in Figure 3, you will browse to your publish settings file, select it, and then click Open; thus, displaying the path to your file in the ‘Import Publish Settings’ dialog as in Figure 4, and then click OK.

Step 3 - Click Import
Figure 3 – Click Import
Step 4 - Browse For Publishing File
Figure 4: Browse For Publishing File

Once the settings have loaded enter the password for your account and click Test Connection.  If everything is OK you will see a check mark next to the test connection button as in Figure 5.

Step 5 - Enter Password and Validate Connection
Figure 5: Enter Password and Validate Connection

Clicking Next will then take you to the ‘Settings’ tab.  I did not change anything here as I did not see the need for any file publishing options and I do not want the publish to modify my database.  I may need to update my publish settings and insert a connection string for my database once I have that configured within my application and will update this post with any such changes.  Clicking Next again brings me to the ‘Preview’ tab as in Figure 6.

Step 6 - Preview and Publish
Figure 6: Preview and Publish

Clicking ‘Start Preview’  in the middle of the screenshot above (Figure 6) will provide a list of the files being uploaded and the action being performed (i.e. update for files being modified and add for new files being pushed to the destination) as in Figure 7.

Step 7 - Clicking Preview
Figure 7: Clicking Preview

Lastly you click Publish to finish off the process which will publish your application to its destination.  The output of the file will look similar to that of Figure 8 (I cropped out the middle section as to highlight the start and end sections as well as displaying some of the adds and updates.  The web application (at the URL provided) will then open up in your default web browser.

Step 8 - Output
Figure 8: Output

If their are issues with the settings in your application when running on the remote server an error page will be displayed with some information as to what you have to do.  At this point it becomes a matter of experimenting.  In my case I got a security exception stating “The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application’s trust level in the configuration file”.

I was able to solve this by adding the following line to my web.config file between the system.web tags and publishing again:

<trust level="Full" />

Through further investigative work I determined a second option is changing the configuration on your hosting provider, if they allow it. In my case that involved selecting the option ASP.NET Settings in the same view as Figure 1 above, which in my case was at the bottom of the 3rd column (from the left).  Once in there you set the CAS trust level to Full, Figure 8 below, and while here make sure that the Default webpage language is correct for your application.

CAS trust level
Figure 8: CAS trust level

That appears to be it for now and will have to see what happens once my web application contains a database and actions are being taken if any further modifications to the publishing settings need to be added or modified.