How to add a .NET C # project to a website?

I just finished my first C # project in VS 2008, and now it works well. But now I need to publish this project on my website. This project interacts with my SQL Server 2008 Adventureworks database on the same computer.

I will use the same computer to host the website and host this database. I know HTML, but not how to add a .NET project to a website, especially one that also uses SQL Server. Can you offer me tips on how to proceed?

I started by right-clicking the project and selecting "Convert to Web Application", and then I selected the URL of my site. But then, when I went to this URL, it still shows the original image.

+3
source share
6 answers
  • In IIS, create a website and point it to the directory that you want to host. your website.

  • Make sure the website properties have the default document that you want and the ASP.NET tab has the necessary infrastructure.

  • Use the menu in VS2008 to publish to this directory.

  • Change the connection string in Web.Config to point to the correct database.

+2
source

Asp.Net has two types of projects: a website and a web application project .

, -, -. , , " MsBuild", "", "PrecompiledWeb", , IIS.

0

Windows -, .

→ - → , - ASP.NET.

sqldatasource gridview, .

, F5 defalut.aspx !

http://msdn.microsoft.com/en-us/library/41b1tfyt(VS.80).aspx ,

0

, ASPNETDB , , . web.config , master-default db Visual Studio master.config. , aspnetdbreg.exe - , , .

visual studio 2008, ASPNETDB SQLServer express 2008. , .

0

IIS 7.0, - (, C:\mywebapp).

IIS 7.0.

.

.

- ( , - , - ) " ".

. , (, , URL- http://localhost/myawesomewebapplication/ , myawesomewebapplication ). (...) , (, C:\mywebapp). "". "", " ".

, http://localhost/, .

0

, . :

-: 1. - ASP.NET(File > New > Project > Visual # - Web) 2. ( ) "" "";

" Visual Studio Development Server", IIS. - IIS, IIS. , , " ".

(File > New > Project > Visual # - Windows), , -. , .

0
source

Source: https://habr.com/ru/post/1713669/


All Articles