10

I'm very new to servers & ASP.NET in general.

I have finished an mvc application using visual studio 2013, tested it locally & it's working fully. I have a .mdf database in my app_data too.

I purchased a domain (asp.net hosting), but now I'm totally stuck and don't know how to do from now on.

My purchased server has a folder named "wwwroot" that I'm supposed to put my files in.

I used filezilla to copy the files manually, yet I get a runtime error when opening my site.

Please, I know that this is basic, but would you give me detailed steps to how to deploy it to my domain ? where to put the files and what's the logic.

Thank you so much.

5
  • Do you know any detail about publish? Commented Mar 25, 2015 at 5:07
  • If FTP is the only option you can choose, take a look at this QA stackoverflow.com/questions/14682477/… Also, it might be helpful: asp.net/whitepapers/aspnet-web-deployment-content-map Commented Mar 25, 2015 at 5:07
  • the .mdf file is for SQL Server, you have to add that file on SQL Server and then make changes in the connection string as per the new address of the SQL Server Commented Mar 25, 2015 at 5:13
  • Thank you for the links, @GongdoGong , I would sure look further into them. Commented Mar 25, 2015 at 20:06
  • Thanks a lot for the tip @AbdulRahmanAnsari; I did exactly that, and currently working on the connection string (the host of the site provided it ). Commented Mar 25, 2015 at 20:06

1 Answer 1

8

You can do it without ftp

Publish Your Application

An ASP.NET MVC application can be published to a remote server by using the Publish commands in WebMatrix ,Visual Web Developer, or Visual Studio.

This function copies all your application files, controllers, models, images, and all the required DLL files for MVC, Web Pages, Razor, Helpers, and SQL Server Compact (if a database is used).

Create the publish profile

  • In Solution Explorer, right-click the ContosoUniversity project (not the ContosoUniversity.DAL project) and select Publish. In the drop-down list, select . (With the latest Visual Studio update installed, there is no drop-down list, and the button to click in order to create a new profile from scratch is Custom.)

In the New Profile dialog box, enter "Test", and then click OK.

  • The wizard automatically advances to the Connection tab.

  • In the Service URL box, enter localhost.

  • In the Site/application box, enter Default Web Site/ContosoUniversity

  • In the Destination URL box, enter http://localhost/ContosoUniversity

  • The Destination URL setting isn't required. When Visual Studio finishes deploying the application, it automatically opens your default browser to this URL. If you don't want the browser to open automatically after deployment, leave this box blank.

  • Click Validate Connection to verify that the settings are correct and you can connect to IIS on the local computer.

  • Click Next to advance to the Settings tab.

  • The Configuration drop-down box specifies the build configuration to deploy. Leave it set to the default value of Release. You won't be deploying Debug builds in this tutorial.

  • Expand File Publish Options, and then select Exclude files from the App_Data folder.

  • In the test environment the application will access the databases that you created in the local SQL Server Express instance, not the .mdf files in the App_Data folder.

  • Leave the Precompile during publishing and Remove additional files at destination check boxes cleared.

  • Finally click the publish button.

More details, you can learn from this visual-studio-web-deployment/deploying-to-iis link

1
  • 1
    Ramesh Rajendran thank you very much for the awesome explanation. Though I chose "FTP transfer" in my project's publish, and it worked very well. Currently, I'm using "Microsoft sql server 2012 import and export data" to transfer my database contents ; I managed to do that and all is there is fixing the connection string in my MVC project, then re-publish. Thank you very much for your answer ! Commented Mar 25, 2015 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.