0

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:

  • New project -> "ASP.NET Web Application"
  • Just calling it "WebApplication1"
  • Don't change any code, just go to Build -> Build Solution.
  • Project -> WebApplication1 Properties...
  • Under Package/Publish Web, I select Configuration: Release (it is to my understanding that this must be selected when publishing to a web server - not sure if I'm wrong?)
  • Put this line in Web.config: <customErrors mode="Off"/>
  • Build -> Rebuild Solution
  • Build -> Publish WebApplication1
  • Choose 'File System' and put target as 'C:\CompiledSite'. I tried to use the FTP option, but then it said that some FrontPage Extension wasn't installed at the server. I don't know, I didn't ask for any FrontPage here. So I try this on the C-drive instead.
  • Copy all files from the 'CompiledSite' folder and onto my test folder on my domain.

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.

gosr
  • 4,593
  • 9
  • 46
  • 82
  • Here is the same question: http://stackoverflow.com/questions/3683390/authentication-mode-forms-error. You should open IIS and transform your website into a web application. – vortexwolf Feb 03 '11 at 21:22

5 Answers5

1

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.

Harsh Baid
  • 7,199
  • 5
  • 48
  • 92
  • Can we make the website the whole website like which contain both the user end and server end in C# (not asp.net) using visual studio ? – Rocket Aug 02 '14 at 18:52
  • Yes but don't try it that way. ASP.NET is built so you can write website easily. However for knowing how to do that, you can check creating HTTP Server which can serve any form of content for any purpose. I am curious why you don't what to use ASP.NET and build whole website in your own C# classes only because if its for any small & single purpose (not website!) then creating in C# is Ok otherwise for whole website use some framework like ASP.NET – Harsh Baid Aug 02 '14 at 22:33
  • Your very kind , thank you for your reply , actually i want to make a website like this http://www.sbb.ch/en/home.html , like just simple website , do i need to use asp.net for it ? as i am also good in php and javascript – Rocket Aug 03 '14 at 11:24
  • 1
    This kind of website should be built using ASP.NET or any other framework you like for website development. – Harsh Baid Aug 04 '14 at 07:27
0

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

Chingiz Musayev
  • 2,832
  • 1
  • 14
  • 6
0

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!

Mark Avenius
  • 13,679
  • 6
  • 42
  • 50
  • Never heard of IIS before, but I've searched about it a little just now. Do I really have to buy anything to get it to work? Could you tell me a little more please? – gosr Feb 03 '11 at 21:41
  • On the server, if you right-click on Computer and go to Manage, you will have a section for Internet Information Services. In here, you need to change your virtual directory to be an application. Which operating system is your server ruining? – Mark Avenius Feb 03 '11 at 22:17
  • Thanks for trying to elaborate, but I'm afraid this wasn't the solution required. I have no idea what OS my server is running (I don't own the server), and I don't have any IIS thing installed. – gosr Feb 05 '11 at 23:55
0

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

Omidoo
  • 493
  • 1
  • 6
  • 14