Problem Deploying ASP.NET Website

Status
Not open for further replies.
Hello All,

I've got my rinky dink, first-ever website finally ready and now I'm trying to get it working on the remote server that it is going to run on, but I'm having some strange problems, namely:

1) Event handlers don't seem to get fired
1.1) I added a label that should have its text changed when a button is clicked, but doesn't happen
1.2) That same label should get some different text in the Page_Load() handler, but nothing
2) My service that grabs the pictures to display doesn't return anything (possibly not even running???)
2.1) It is simply supposed to grab photos in the folder right beneath the run directory
2.2) Running FireBug shows that the <img> is not getting a source, when I run it locally it does grab the photos correctly

What I am doing wrong here?

I have set the main/photo directories as website shared.

What other information is necessary for anyone to help me?

IIS 6.0
Windows Server 2003 SP2
ASP.NET 3.5 project

Thanks a lot
 
Akula":2af76lpj said:
I don't know what the book is telling you, but you can't just take a bunch of .aspx and .vb/.cs files and put them on a web server expecting them to work.

Which makes sense to me. I'm sure I was misinterpreting what the book was saying (it has been on the mark with everything else) and this definitely seems like the simple, beginner mistake I was anticipating my issues would come down to. I'll report back when I confirm that this fixed it.
 

Xavin

Ars Legatus Legionis
30,828
Subscriptor++
That's actually not true. Depending on the version and kind of web project you are using you can absolutely just dump a bunch of aspx and cs files on the server and have it work. At the least, copying everything in your project folder, including the bin folder should get it to work (or at least get semi-helpful error messages about why it's not).

It's much more likely there are server configuration issues, recent versions of IIS are locked down for security reasons to the point where they won't run asp.net applications right off. Is this your server where you have management console access, or is it under someone else's control?
 
Xavin":181iiwuk said:
It's much more likely there are server configuration issues, recent versions of IIS are locked down for security reasons to the point where they won't run asp.net applications right off. Is this your server where you have management console access, or is it under someone else's control?

Thanks for the validation, I was conflicted about this stuff since the book and some websites were telling me I could just dump things out there and it would "just work" but then went against went I have learned from other development.

Anyways, to answer your question, I have complete control of the box and can do with it as I please. What settings should I be checking? I was hoping/thinking it was some sort of IIS/server setting that I was missing since it worked fine "on my machine".

In any case, I went through the process of compiling the site using the aspnet_compilation tool and dumping the results of that into my directory that is used by the website with the same results (no pictures shown, no img src shown, no cycling of supposed images, no event handlers hit).

EDIT: Could the fact that I am targeting ASP.NET 3.5 have anything to do with this? I wouldn't think so since it at least loads the page, but I thought I would throw that out there.
 

Xavin

Ars Legatus Legionis
30,828
Subscriptor++
Even with a Web Site project (Web Application being the other type), it must be Built before it can be deployed.
No. You made me doubt myself, so I just checked. I created a Web Site project, a simple aspx with cs codebehind and dumped them in a new IIS application. It ran, and the codebehind worked. Never complied it in VS at all. It's been that way since 2.0 as long as you use a web site project (you should be in almost every case).

Anyways, to answer your question, I have complete control of the box and can do with it as I please. What settings should I be checking? I was hoping/thinking it was some sort of IIS/server setting that I was missing since it worked fine "on my machine".
It almost certainly is an IIS thing, the built in webserver, IIS on your own machine, and IIS on a Server 200X install all have different defaults and security settings. It doesn't help that they have changed up the interface with every version of IIS so nothing is where you expect it to be.

First, did you make a web application (in the IIS management console) that points to your files? It probably won't work to just dump them in the root of Default Website. After that, check your handler mappings, it sounds like it could be processing aspx files as static for some reason. I seem to remember running into servers that were missing the aspx handler, or had it set wrong. You might try running asp_regiis -i to fix a lot of potential issues.

Sorry I can't give more detailed instructions, but like I said, they have changed the details of all this stuff many times, and I don't have a 2003 install around to look at.
 

Xavin

Ars Legatus Legionis
30,828
Subscriptor++
EDIT: Could the fact that I am targeting ASP.NET 3.5 have anything to do with this? I wouldn't think so since it at least loads the page, but I thought I would throw that out there.
Unlikely, as far as IIS is concerned 2.0-3.5 are the same exact thing. The only issue you can run into is if you are using 3.5 dlls and 3.5 isn't installed on the server, the runtime is the same.
 

blindwaves

Wise, Aged Ars Veteran
135
You need to check what kind of project you are using. If you are using a Website Project, you can just throw all the files into wwwroot and it will work. If it is a Web Application Project, you need to build it first, publish, throw the files into wwwroot and then tell IIS to make it an application.

If I'm not mistaken, the way to differentiate between them is if you have the "bin" and "obj" folder in your project, it's a Web Application, if it doesn't it's a Web Project.
 
Alright, so a couple more pieces of info.

Yes, I did create a Web Site through the IIS Management Console, the mappings are there for .asp and .aspx and both point to aspnet_isapi dll's in the v2.0.x framework folder. The 3.5 SP1 version of the .NET Framework is on the server box.

When I run the site locally, the slideshow extender service starts and the associated play/pause button is on pause (as the service is running by default). When I run it through the server, the button is on play and pressing the button does switch it to pause, but no pictures are displayed. I have a tiny piece of javascript on the site that enables a button when a certain amount of text is entered in a textbox, this part works on the server.

I restarted the IIS on the server and no change in behavior after that.

I did some more digging and saw that I needed to make sure that the ASP.NET extensions were allowed to run under the Web Service Extensions node in the IIS management console, and those were set up correctly already.
 
blindwaves":1odxa38l said:
You need to check what kind of project you are using. If you are using a Website Project, you can just throw all the files into wwwroot and it will work. If it is a Web Application Project, you need to build it first, publish, throw the files into wwwroot and then tell IIS to make it an application.

If I'm not mistaken, the way to differentiate between them is if you have the "bin" and "obj" folder in your project, it's a Web Application, if it doesn't it's a Web Project.

Going by your description, I have a web project. How do I tell IIS to make it an application? Is that right click->New->Website? If so, I've already done all that (I used the new website wizard through IIS) except for the part about having them in the wwwroot folder.
 

blindwaves

Wise, Aged Ars Veteran
135
Sorry about the wwwroot part, just a lazy way of saying the folder that is relevant to you.

I'm going by memory here for IIS6, so I might make some mistake. Right click the folder that contains your app, properties. In the directory tab at the bottom there should be a section for "Appplicatiomn Name" and a button "Create", click that. If there is a button "Remove", then don't touch anything.

Next you need to ensure that it is using the correct .NET. So under the ASP.NET tab, make sure it is running 2.0xxx, apply the settings and see if that helps.

That is more or less the steps that I remember for IIS6.
 
blindwaves":2jdwaviy said:
Sorry about the wwwroot part, just a lazy way of saying the folder that is relevant to you.

I'm going by memory here for IIS6, so I might make some mistake. Right click the folder that contains your app, properties. In the directory tab at the bottom there should be a section for "Appplicatiomn Name" and a button "Create", click that. If there is a button "Remove", then don't touch anything.

Next you need to ensure that it is using the correct .NET. So under the ASP.NET tab, make sure it is running 2.0xxx, apply the settings and see if that helps.

That is more or less the steps that I remember for IIS6.

I just rechecked all of that and everything seems ok.

I am going through other settings and noticing something weird. I am trying to web share my folder at C:\Website on the server with my website (setting it "Share on: [WEBSITE]"), but do I need to set Aliases for that? Regardless of that, every time I hit apply and close the dialog and then re-open it, my setting is reset and it is claiming that it is sharing the folder with the "Default Web Site"? Is this part of the problem or a red herring?

Another aspect I will mention is that I am using a networksolutions.com domain name and forwarding the domain name to the IP address of the server I am using, would that have any effect on this?

Thanks a lot for all of the help. This project that was supposed to be just a fun experiment is turning into a huge hassle.

EDIT: Are there any other IIS settings that could be causing this behavior/preventing my website from just working?
 
blindwaves":1hi85pv3 said:
Have you tried 'deploying' on your development com?

I have not. I did stumble upon Fiddler via my brother-in-law, which has told me that I am getting the following error in my webservice:
{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}

I've done some googling which seems to indicate that to figure out the real problem I need to turn off custom errors in my web.config file. I did change the setting to "off" and then stopped and restarted the website, but it still isn't giving me a different error. Do I need to restart IIS? Is there anything from my Fiddler output that would be of any use in figuring out the actual problem?
 
Through the kindness of my brother-in-law and one of his coworkers who does ASP.NET for a living, my website is working.

The issues (as they were explained to me) that were causing the behavior I saw:

1) The webservice was looking for the photos in the root directory, moving them there allowed the pictures to display
2) A SQLAuth account needed to be added to the server and my connection strings updated to use this account

With those changes, everything is working. Now I've just got to get the finishing touches done.

After all of this hassle, I think I'll stick with the safety of desktop apps :)

Thanks for all of the assistance, everybody. I really appreciate it.
 
Status
Not open for further replies.