|
-
Nov 7th, 2011, 09:10 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Difference Web Site and Web Application
I asked a question a while ago about whether to create a Web Site or a Web Application ... and the consensus seemed to be in favour of Web Application projects.
So, I have just created my first Web Application project - which, when you set it up, is described as 'A project for creating an application with a web user interface'.
First stupid question - is a Web Application project going to be accessible from the internet - i.e. can you deploy it on a Windows server running IIS so that anyone with a web browser can use it?
If this is true (and if it is what is the difference between a Web Application project and a 'Web site'?) - how do you publish it?
I am working on an intranet and, when publishing to a Windows Server 2003 running IIS 6 I could publish to http://somedomain/somesite as FrontPage Server Extensions are available. But, more recent sites are published to a Windows 2008 server running IIS 7.5 and I have been publishing to a file path. So I just publish to \\servername\websites\website1 and it all works okay.
But with this web application project there seems to be a lot more options for publishing. I want to publish using a file path so I selected File System and just tried to publish to a server on the network. All I get is 'Publish failed' - no clue as to why. The receiving folder is definitely there with a 'hello world' default.aspx file in there which, if you go into IIS and browse, runs okay.
Can anyone give me any tips on how to publish this because, any minute now, I'm going to have to give up and create another 'Web Site' and copy all the files over and start again.
Thanks for any help.
Last edited by Webskater; Nov 7th, 2011 at 09:15 AM.
-
Nov 7th, 2011, 03:22 PM
#2
Re: Difference Web Site and Web Application
 Originally Posted by Webskater
First stupid question
There are no stupid questions 
 Originally Posted by Webskater
is a Web Application project going to be accessible from the internet - i.e. can you deploy it on a Windows server running IIS so that anyone with a web browser can use it?
You certainly can, yes.
 Originally Posted by Webskater
If this is true (and if it is what is the difference between a Web Application project and a 'Web site'?) - how do you publish it?
You do it in much the same way as you have always done it. The primary difference being that rather than having lots of .cs or .vb files everywhere, all the code is compiled up into a single DLL.
 Originally Posted by Webskater
But with this web application project there seems to be a lot more options for publishing. I want to publish using a file path so I selected File System and just tried to publish to a server on the network. All I get is 'Publish failed' - no clue as to why. The receiving folder is definitely there with a 'hello world' default.aspx file in there which, if you go into IIS and browse, runs okay.
Can anyone give me any tips on how to publish this because, any minute now, I'm going to have to give up and create another 'Web Site' and copy all the files over and start again.
Can you share the settings that you are using?
Typically what I do is I "publish" to a local folder on my computer. Then, depending on whether I am using FTP, or a UNC path to the server, I just copy the files from the "published" directory.
Gary
-
Nov 7th, 2011, 04:27 PM
#3
Thread Starter
Fanatic Member
Re: Difference Web Site and Web Application
Hi Gary and thanks for your reply.
When I publish a web site the Publish Web Site dialog window has Target Location at the top (ftp://..., http://... or drive\path) and in the box I enter
\\server1\WebSites\Site1
Underneath there are four checkboxes next to:
- Allow this precompiled site to be updateable
- Use fixed naming and single page assemblies
- Emit debug information
- Enable strong naming on precompiled assemblies
I don't tick any of them and, when I publish, the server ends up with all the .aspx files in the directory I publish to and, in the bin directory, there seems to be a .compiled file for each page and a number of dlls.
Trying to publish the web application project - I see a Publish Web dialog window that has Publish Profile at the top.
Below is a drop down list showing Publish Methods - File System, Web Deploy, FTP, FPSE.
The server I am publishing to is Windows 2008 R2
So, I am selecting File System and, in the Target Location box I am putting:
\\server1\WebSites\Site2
All that happens when I click Publish is that is says 'Publish Failed'. But you're saying you publish to a local folder and then copy the files to the server?
I have just tried publishing to a local folder and (I think) this worked okay - the folder ended up with a file for each page and one dll and a .pdb file.
I'm guessing I can test before moving to the server by browsing to this folder? (Haven't tried yet - will try in a minute).
Thanks again.
Last edited by Webskater; Nov 7th, 2011 at 04:34 PM.
-
Nov 7th, 2011, 04:55 PM
#4
Re: Difference Web Site and Web Application
Is there nothing in the output window to indicate why the initial publish of the Web Application didn't work?
It wouldn't just fall over without giving any indication of what happened.
If you wanted to "test" it locally, you would need to actually publish to a configured Virtual Directory under your local IIS. Or, you could just run it out of Visual Studio.
Gary
-
Nov 7th, 2011, 06:33 PM
#5
Thread Starter
Fanatic Member
Re: Difference Web Site and Web Application
 Originally Posted by gep13
Is there nothing in the output window to indicate why the initial publish of the Web Application didn't work?
It wouldn't just fall over without giving any indication of what happened.
If you wanted to "test" it locally, you would need to actually publish to a configured Virtual Directory under your local IIS. Or, you could just run it out of Visual Studio.
Gary
Nothing at all in the output window - apart from the usual things I always see like a few css warnings - nothing that ever stops the application from running.
Cheers
-
Nov 7th, 2011, 06:41 PM
#6
Re: Difference Web Site and Web Application
:LOL: I asked the same thing here.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Nov 8th, 2011, 02:37 PM
#7
Re: Difference Web Site and Web Application
Hmm, that does indeed sound a bit strange! I would definitely expected to see something logged to the console if the publish didn't work. I which case I can only assume that it is a problem with writing to the network share. Are you running Visual Studio as administrator?
Gary
-
Nov 8th, 2011, 02:37 PM
#8
Re: Difference Web Site and Web Application
Hmm, that does indeed sound a bit strange! I would definitely expected to see something logged to the console if the publish didn't work. I which case I can only assume that it is a problem with writing to the network share. Are you running Visual Studio as administrator?
Gary
-
Nov 8th, 2011, 03:32 PM
#9
Thread Starter
Fanatic Member
Re: Difference Web Site and Web Application
 Originally Posted by gep13
Hmm, that does indeed sound a bit strange! I would definitely expected to see something logged to the console if the publish didn't work. I which case I can only assume that it is a problem with writing to the network share. Are you running Visual Studio as administrator?
Gary
Hi Gary - I seem to have got over that hurdle - by doing as you suggested and publishing to a local folder - and then copying the files to the server.
Now all I have to do is get it to run.
If I go into IIS and browse the site I am seeing this:
An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.
My web config is essentially a copy of the web config I use in the web sites I have published to the same server - which all run okay.
More error info:
Module: ConfigurationValidationModule
Notification: BeginRequest
Handler: StaticFile
Error Code: 0x80070032
Most likely causes:
system.web/identity@impersonate is set to true
In all the web sites I have published - identity impersonate is always set to true because we are using windows authentication.
Help!
Edit: Here's some of the web.config
<system.web>
<customErrors mode="Off" />
<authentication mode="Windows" />
<identity impersonate="true" />
<compilation targetFramework="4.0">
<assemblies>
.... a few assemblies are listed ... System.Web.Extensions.Design ... System.Design ... System.Windows.Forms ...
</assemblies>
</compilation>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Last edited by Webskater; Nov 8th, 2011 at 03:39 PM.
-
Nov 8th, 2011, 03:34 PM
#10
Re: Difference Web Site and Web Application
Hello,
Looks like the Application Pool that is running your application is not set up correctly. I would suggest that you do a comparison between the Application Pool setting between the one that is working, and the one that isn't. Specifically with regard to the setup of the pipeline, i.e. whether it is integrated or not.
Gary
-
Nov 8th, 2011, 03:49 PM
#11
Thread Starter
Fanatic Member
Re: Difference Web Site and Web Application
 Originally Posted by gep13
Hello,
Looks like the Application Pool that is running your application is not set up correctly. I would suggest that you do a comparison between the Application Pool setting between the one that is working, and the one that isn't. Specifically with regard to the setup of the pipeline, i.e. whether it is integrated or not.
Gary
Hi Gary
I am using the same application pool that the two web sites that run on there use.
The properties are:
.Net Framework Version: 4.0
Pipleline mode: Integrated
Thanks again for your help.
-
Nov 8th, 2011, 03:52 PM
#12
Re: Difference Web Site and Web Application
Hello,
So you are saying that if you compare the web.config from one application and this one, you don't find any additional elements/configuration, aside from the obvious application differences.
Gary
-
Nov 8th, 2011, 04:07 PM
#13
Thread Starter
Fanatic Member
Re: Difference Web Site and Web Application
 Originally Posted by gep13
Hello,
So you are saying that if you compare the web.config from one application and this one, you don't find any additional elements/configuration, aside from the obvious application differences.
Gary
I copied the web config from a web site that is already developed and working and used it as the web config for this web site application.
I read somewhere to add:
<validation validateIntegratedModeConfiguration="false" />
into <system.webServer>
I did this and now something seems to be happening - but this just confuses more. Now I am getting the old Server Error in '/Contacts' Application
Parser Error Message: The file '/Contacts/MasterMaintenancePage.master.cs' does not exist
And this line is highlighted in red:
<% Master Language="C#" AutoEventWireup="true" CodeFile="MasterMaintenancePage.master.cs" Inherits="MasterMaintenancePage" %>
Why is it looking for a .cs file? I thought the idea was that all the .cs files got compiled into a dll. Which is certainly what seems to have happened if you look in the directory where the files are. Just .aspx files and, in the bin, a few dlls. Why is it looking for a .cs file?
-
Nov 9th, 2011, 08:37 AM
#14
Re: Difference Web Site and Web Application
Hello,
The reference to the .cs in the ASPX is normal. The actual lookup in the DLL is handled for you.
Have you tried with just a blank web application, fresh out of Visual Studio?
Gary
-
Nov 9th, 2011, 08:47 AM
#15
Thread Starter
Fanatic Member
Re: Difference Web Site and Web Application
 Originally Posted by gep13
Hello,
The reference to the .cs in the ASPX is normal. The actual lookup in the DLL is handled for you.
Have you tried with just a blank web application, fresh out of Visual Studio?
Gary
I should have used a blank web application in the first place ... I did create a blank web application but then, to give myself a head start, I copied in some pages - a master page - and a default.aspx page - from an existing web site.
I didn't realise that all the .cs files in a web application had to be within a namespace. And that Codefile is no use - you need codebehind.
Seem to have it working now.
Thanks again for all your help - I would have reported earlier today but this site seemed to be unavailable?
-
Nov 10th, 2011, 11:08 AM
#16
Re: [RESOLVED] Difference Web Site and Web Application
Hello,
Ah, I should have mentioned that.
Also, there is the option to convert a web site to a web application within Visual Studio, which would have taken care of that for you.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|