In Framework 4.0 I have a little console app. I have a self-contained .aspx page (no codebehind) and would like to run the console app just to host this page. I searched around for tricks with System.ServiceModel.Web or System.Web.Services trying to find a way to do this.
Can anyone help me get clue?
Thanks.
Have you seen this article? It's not written for asp.net 4.0, it's written for asp.net 2.0, but I don't think there's much difference.
The easiest way to host ASP.NET on a simple web server is to use the Cassini web server, which you can download from MS, including source code. The following two links help:
http://en.wikipedia.org/wiki/Cassini_Web_Server
http://www.asp.net/downloads/archived-v11/cassini
After downloading, the only things you need to do are:
Comment out lines 92 through 96 of request.cs such that Cassini does not discard
requests coming from hosts other than localhost.
Run build, which builds and installs the Cassini library into the GAC.
Run the server.
Note: Cassini is a Console app, which just happens to show a form. If you're interested in it working purely as a Console app, refactor and remove the form. It should not be hard.
Related
First off, I'm not a web developer, so I might be asking the question in the wrong place. Unfortunately, I've tried searching regarding my problem but most of the issues I see are web-developer server side issues, so I'm runnig out of places to turn.
The problem: I'm trying to navigate a website, and eventually it decides to try running a ".asp" page. However, my browser just hangs (attempted Firefox and IE11), until it eventually times out. However, when I've run the same website on other machines (such as my phone), those pages load flawlessly. The fact that it's browser independent seems to suggest it's something with my local machine (Win7). I've ensured the IIS feature is turned on and the process is running, but still nothing.
The only other evidence I have is while searching for ASP tutorials, there was an example designed to show the current date/time which didn't work. The rest of the page which was straight HTML was then fine. I'm not sure if it's possible that some native binary for a scripting language isn't loading, but I'm not sure how I can debug that.
To summarise, my questions are as follows:
What could stop an ASP page being loaded on a client machine?
What can I do to ensure the right dependencies are present on a client machine such that it can load ASP pages?
To note, I'm not aware of anything I've installed which would affect this. The only code related program on my PC is Visual C++ Express 2013, but I'm not sure what that would do. .Net 4.5 is installed but I don't know how to tell what script the asp page is attempting to execute.
* What could stop an ASP page being loaded on a client machine?
IIS?
IIS is the one responsible for parsing asp code.
IIS takes your ASP code, and then, transforms it into html code, then sends it to the client.
There might be an issue with your windows 7 computer, but there is nothing related to ASP.
* What can I do to ensure the right dependencies are present on a client machine such that it can load ASP pages?
There are no such dependencies. Your client makes a call to a server, which returns html code.
I was hoping to get some people's expertise as I'm currently outside my main domain. I'm currently working for a client that has an old system written in VB6 COM Objects. They use these to do basic Database interaction. These COM Objects are used in a Classic ASP website.
I've been tasked with getting the site up, running and in a build-able environment (Windows 8.1 is what they want to use).
I've been working through all the blockers associated with this and I believe I have it in a running state (as in I've configured IIS and been able to run the website, log in and click around and so far nothing has crashed).
I can make changes to the code in Visual Studio 6 Enterprise and those changes are working so I'm confident I've got that about 90% of the way there.
I've now got 2 problems both somewhat related:
Problem 1:
Problem 1 is now debugging, both the ASP & the VB code.
I can put a break point in the VB code and 'Step-Into' it (to attach) and then run the site and the code that runs in the global.asa file gets run and hits that breakpoint no worries, can step through as I would expect.
The problem then comes when I go to 'login' to the system. I use the same user/password that works if I'm not 'attached' the system crashes with a "An unhandled exception ('Error in loading DLL') occurred in w3wp.exe [3284]." - If i try to load up a debugger from this Visual Studio 6 is not an option in the list. If I then detach and I can do everything as before.
Does anyone know what could be causing this? Or have another way to be able to debug/step through this?
Problem 2:
They had previously been 'running' the website through Visual InterDev 6.0 - they could add breakpoints to the Classic ASP code and be able to step through then into the VB components.
The problem is that although I can install InterDev on my machine, I can't actually set it up. It appears to need FrontPage Server Extensions which although they can be 'installed' on IIS 8.5 they don't seem to be officially supported by Microsoft. So I've managed to install it without any issues but it doesn't seem to be configured in the same way that InterDev needs it to be able to setup a solution file/run from it.
My Question is this: Has anyone been able to configure FrontPage Server Extensions in a way that InterDev works?
OR is there any other tools I could use to 'run' a Classic ASP site that would allow me to debug it properly.
Let me know if you need any more information.
Thanks in Advance,
Michael
I think you actually don´t need Interdev in order to debug the classic ASP code. Just create a blank solution in Visual Studio and add all the classic ASP files from the virtual directory (editor and debugging capabilities for classic ASP files are still supported, even in the latest version of Visual Studio).
I assume you run the web application in your local IIS... once you have the solution, open the script of interest, put some breakpoints and than attach the Visual Studio debugger to the web server´s worker process (which should be w3wp.exe). Maybe you need to manually select the Script code type (automatic code type detection might not work).
As far as I can work out I should be able to copy a web project/application to my IIS Web server and be able to see it as I do when designing it on my development computer.
The problem is once I copy the folder over to my web server and then try to view it the browser it says Error 404 not found. There must be a real simple fix for this. I would like to be able to develop ASP.NET sites using the Visual Web Developer instead of Dreamweaver but this little issue is stopping me. Any ideas?
Cheers,
Darren Woolway
You can't just copy over the files and expect it to run. You have to do a little more work than this.
please see the following;
non iis7: http://support.microsoft.com/kb/323972
iis7: http://learn.iis.net/page.aspx/37/deploying-web-sites-on-iis-7/
Hey guys, I'm having a super weird problem with my VS 2008 solution.
We had this hand-coded ASP.NET compiled web app on our old IIS6/Win2003 server, working great, moved it to our new IIS7/Win2008 server, still working great, but when I try to compile the application and publish it again to our new Win2008 server, I get server 500 errors. It's ASP.NET 2.0 with AJAX extensions and AJAX control toolkit.
I'm not too great with server issues, or even sure if it is a server issue but here are some more symptoms... ?
I know the website works (it only differs by some minor code fixes) and can use it's code on a development machine, there are no errors, and it publishes fine. Publishing (using the DLL files), and even not publishing and trying to use the code-behind files on our new server, both no success. The old website does work on the new server just fine.
If I put a simple hello world html page in the website's virtual directory, with the old code, it works fine, but with the new code, that html page gets the 500 error. And in fact, oddly, I can add all the files to the website, only when I add the web.config, do I get the 500 error. The web.config has not changed.
Tried stopping and restarting IIS
What's the problem, here? Any ideas, what else can I do to troubleshoot the problem?
Check what IIS7 is running under .NET 2.0 or .NET 3.5?
Its tough to see without being there, have you checked which App pool the server is running the site on? (default should be OK, I have found some to be set to classic which causes problems with the AJAX control toolkit)
Also you could try aspnet_regiis -i (if the server is 64 bit make sure you run the one under the 64 bit version of .net)
It was a IIS 7 to 8 issue.
Both machines have different assemblies that need to be just-so on the web.config, in addition with IIS7 web.config changes to make AJAX happy (it has new XML sections).
I have an ASP.Net 2.0 web site, using the DotNetNuke framework (4.09), and it will not compile, but when I hit the site in a browser, it works. Even the parts that don't compile will work. How is IIS able to compile and run this site, when Visual Studio can't? Everything is the same in both places... I copied the entire web site from the remote server on to my local machine, then I set it up in IIS the same way. On my local machine, Visual Studio can't compile the site, but it still runs. How can this be possible?
The specific errors are not important, as there are 189 of them, from every possible part of the site. I'm not trying to fix the errors... what I want to know is how it's possible for the web server to run the site, regardless of the errors. Please pay attention to what I have written - everything is exactly the same in both places. There are no missing DLLs, no different configurations, nothing on the machine itself... remember, the site runs fine on my local machine.
Is this a web site or a web application? If it's a web application, you're probably still running off the last successfully built bits in the bin.
The site is using old dlls, or possibly you have references missing in your local version that the server has just fine.
As Mitchel said, we need to see the error before we can really answer your question.
To give you an answer on this we would need to know what the errors are.
Your local machine cached the 'working' copy and is using that maybe?
The site was compiled successfully at one point as it works on the remote server. Thus, copying it to your local machine and hitting the local site will also work. However, there can be several reason why you can't re-compile it on your local machine including; missing references, web.config entries, third party control licensing, etc..
I realize you are not trying to correct the 189 errors, but there are clues, if not answers, in the error listing that will get you moving in the right direction.