gosr
gosr

Reputation: 4708

C# website built in Visual Studio 2010 doesn't work on server

I have built my new website in Visual Studio 2010 (C# - ASP.NET 4). Back when I started the project, I selected "ASP.NET Web Application" in the 'New Project' window.

I have also just gotten a new web host / domain, where I will put my website. And yes, the server does support ASP.NET 4.

I wanted to make a small "test project", to see if my final website would work as well. Problem is, I can't even make this small test project work on the server.

If you have Visual Studio installed, you can follow these steps if you like, but I will write what happens too:

I get this error:

enter image description here

In the file "Web.config".

Please, I have no idea how to fix this and please let me know any info on how to get my test site up and running.

Upvotes: 0

Views: 1495

Answers (5)

Omidoo
Omidoo

Reputation: 513

go to your hosting account then try to find a link (probably called 'content') then go to IIS Settings then add a folder as an application (probably a checkbox used to confirm it as an application). It will take a little time to be processed. say 5 minutes. It should work, if didn't let us know

Upvotes: 0

Mark Avenius
Mark Avenius

Reputation: 13947

As the error states, you need to configure your virtual directory as an application. This is done within IIS.

In IIS 7 (Server 2008 or Win7):

  • Expand Sites
  • Browse to your virtual directory
  • Right-click
  • Select Convert to Application.

In IIS 6 (or I believe below) (Server 2003):

  • Browse to your virtual directory
  • Right-click
  • Go to Properties
  • Click Create next to where is says Application

That should do it!

Upvotes: 0

Harsh Baid
Harsh Baid

Reputation: 7249

upload your site in the root folder of your site or virtual directory and upload the content of CompiledSite not the folder itself. if you mention the folder at host server then it would be more fine to help you.

Upvotes: 1

Chingiz Musayev
Chingiz Musayev

Reputation: 2982

Go into IIS Manager and mark the virtual directory as an application.

Upvotes: 0

Related Questions