Blog · WebJi® India

How to Host an ASP.NET Website

Quick answer: Publish the project first, upload the publish folder to the Windows account, then set that folder as the site root. Match the .NET runtime to the project and put the connection string in web.config. The site works when the home page renders and a database-backed page returns rows.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Focused Indian analyst studying analytics charts across two monitors — how to host asp.net website

What ASP.NET needs from a Windows host

Publish the project first, upload the publish folder to the Windows account, then set that folder as the site root. Match the .NET runtime to the project and put the connection string in web.config. The site works when the home page renders and a database-backed page returns rows.

Four things have to line up: Windows Server with IIS, the runtime the project targets, a folder IIS treats as the site root, and SQL Server if the app reads a database. Linux hosting runs none of the .NET Framework stack.

Publish the project before you upload

Publishing compiles the code and copies only the files needed at run time. Uploading the project folder instead is the most common reason a first deployment shows source files or a compile error.

Project typeCommandWhat it produces
ASP.NET Coredotnet publish -c Release -o ./publishA publish folder with the DLLs, views and static files
.NET Frameworkmsbuild MyApp.csproj /p:DeployOnBuild=true /p:PublishProfile=FolderProfileA publish folder ready for IIS
Visual StudioBuild, then PublishThe same folder, through the UI

The dotnet command ends with a line naming the output, such as App -> C:\src\MyApp\publish\. That folder is what you upload.

Upload and set the site root in IIS

Upload the contents of the publish folder to the account, not the folder itself, so that default.aspx or the Core DLL sits at the document root. On a VPS, open IIS, right-click Sites, choose Add Website, and set the physical path to that folder.

On shared Windows hosting the panel does this for you: map the domain to the folder and the host writes the IIS binding. Web Deploy or FTP both work; Web Deploy is faster on repeat deployments because it syncs only changed files.

Match .NET Framework or ASP.NET Core runtime

.NET Framework 4.8 ships with Windows Server, so a Framework app runs once the site root and app pool are set. ASP.NET Core is different: IIS needs the Hosting Bundle, which installs the AspNetCoreModuleV2 and the runtime.

Shared Windows plans rarely allow that install. If the project targets .NET 8, 9 or 10, plan on a Windows VPS where you control the server, or publish self-contained so the runtime travels with the app.

web.config and the connection string

web.config carries the connection string, the handlers and the app settings. Keep the database values in one connection string rather than scattering them through code.

SettingWhat to put in it
ServerThe MSSQL host and instance name given by the host, not localhost on shared plans
DatabaseThe full database name, including any account prefix
User Id and PasswordThe database user created in the panel, with rights on that database
TrustServerCertificateTrue only when the host's certificate chain is not trusted; ask first

Keep web.config out of public source control when it holds production credentials. A separate file per environment avoids pasting production values into a laptop build.

Test the home page and one database page

Load the home page first. A static home page can render while the database connection is still broken, so the second test matters more: open a page that runs a query and returns rows.

From a terminal, curl -I https://example.com should return HTTP/2 200 and the expected server header. If the home page is 200 and the database page throws, the problem is the connection string or the SQL grant, not IIS.

Errors that name the fix

IIS error codes are specific. Read the code and the sub-code before changing files.

ErrorWhat it means
500.19web.config cannot be read: malformed XML, a duplicate section or a locked section.
500.30The app started and failed. Check the stdout log for the exception.
500.31The ASP.NET Core module could not find the runtime. Install the matching Hosting Bundle.
403.14No default document and directory listing is off. Add default.aspx or the route.
404.3The handler for that extension is not enabled in IIS.
Login failed for userThe server was reached. The database user or password is wrong.

Where WebJi fits

WebJi runs Windows shared hosting with MS SQL. Win-SQLPro is ₹2,300 a year, Win-SQLDev is ₹4,200 and Win-SQLDev+ is ₹8,400, all before 18% GST. Those plans suit an ASP.NET Framework site with a SQL Server database.

ASP.NET Core on the Hosting Bundle, or an app that needs its own IIS modules, is a Windows VPS quoted by email before payment. WebJi is a hosting company, not a Microsoft partner, and the runtime you need depends on the project. Start with Windows hosting, compare the plan prices, or move to VPS hosting when the stack needs root.

Support is by email at support@webji.services, 24/7 in Hindi and English, with an average first reply under 60 minutes. Send the IIS error code, the .NET version and the publish command you used.

Frequently Asked Questions

How do I host an ASP.NET website?

Publish the project, upload the publish folder to a Windows account, set that folder as the site root, and match the .NET runtime to the project. Put the database connection string in web.config, then test a database-backed page.

Can ASP.NET Core run on Linux hosting?

Yes, ASP.NET Core runs on Linux with Kestrel behind Nginx. ASP.NET Framework does not; it needs Windows and IIS. The shared Windows plans on this site target the Framework and MS SQL stack.

How do I publish from Visual Studio to my hosting?

Use Build, then Publish, and choose a folder or Web Deploy profile. The equivalent command is dotnet publish -c Release -o ./publish. Upload the contents of that publish folder, not the project directory.

What does web.config do?

It holds the connection strings, handlers and app settings that IIS reads for the site. A malformed web.config is the usual cause of a 500.19 error.

Which .NET versions do hosts support?

Windows Server ships with .NET Framework 4.8. ASP.NET Core needs the Hosting Bundle for the targeted version, which shared Windows plans often cannot install, so Core usually means a VPS.

How do I connect my ASP.NET app to MSSQL?

Put the server, database, user and password in one connection string in web.config, and grant that user rights on the database. Test with a page that runs a simple SELECT before you point DNS at the site.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →