How to find Visual Studio's web server's application pool mode? - c#

When I run my website in visual studio 2010, it works.
When I deploy it in IIS, it doesn't work.
Can I find the settings of visual studio's web server? That will be really helpful for learning purpose for me too.

Don't rely on ASP.NET Development Server or even IIS Express (http://learn.iis.net/page.aspx/868/iis-express-overview/).
A long time ASP.NET developer should understand that playing with IIS as early as possible is the correct way.
Show the exact errors that your application reports (on IIS), and then someone can tell you what's up. It is useless to learn more about ASP.NET Development Server as your application is not finally deployed on it.

Use real IIS, lots of stuff is different in integrated mode. If you do httpmodules, you will find anything but real IIS doesn't support stuff like adding headers and such.

The Visual Studio 2010 development web server is an entirely .NET based server. As such it has much more in common with the intergrated pipeline of IIS7 than it does with the Classic. It doesn't support all that the IIS7 integerated pipeline does since it only has to concern itself with delivering .NET and static content and doesn't need the optomisations that IIS7 will employ.

Related

Can't debug my asp.net web app developped on visual studio 2015 and hosted on IIS

I am a telecom engineer, I have studied a little bit of coding but I am not a professional, I have to develop a c# asp.net app for my company and I have some issues with debugging my app with Visual Studio 2015. I hosted my app on IIS (not IIS Express, even if I don't understand the difference), when I hit debug (with Firefox, Google Chrome...) a message of error displays where it is written:
unable to start debugging on the web server the remote server returned an error 400
I have litterally tried everything, can you please help me and give me solutions that I will understand (I am no professional), if you need a screen shot or something please let me know.
Clarifications/details (based on comments, etc.), and since "just use localhost/foo" sounds too magical:
if you're debugging on a remote web server (not your own PC), you'll have to setup the remote machine to allow such. This may or may not be feasible (not your server, etc. etc.).
Hence Visual Studio provides local debugging (Express or local IIS)
What is IIS Express?
When I want to start a project I can eather store it on IIS or IIS Express
Sure, but you'll have to know how to set things up (see links)
When I use IIS, and click on debug, I have error 400 and the browser doesnt open But When I use IIS Express and click on debug, it debugs, the browser opens and I have a 500.52 error
Set debug=true. It should give you error/exception detail(s) (also in link above)
So I am storing my project on IIS (inetpub\wwwroot...) and when I design and write my code I just press start without debug and the browser opens with my app appearing
Same as above, that just means IIS is running your app just like any other ASP.Net app. It does not automatically mean you can attach to it and debug.
While you can certainly develop that way (using /wwwroot), you'll be better off deving in your own directory, using VS/IIS Express, and publish to IIS (as simple as file system copy). You'll also learn what publish means (compiling), what in all your code is "published"/needed in live/production. If you kept deving in IIS the way you are, you'll likely not know the difference.
IIS admin is a bigger topic (multiple apps, multiple sites, and associated configuration).

What is the difference between IIS and Visual Studio IIS in Web Requests?

I am trying to run a custom site on IIS with ASP.NET whih connects to a site on the internet which is a coding community via HttpWebRequest.
If I use the Visual Studio built-in Development Server it successfully runs and shows the result of the Request.
But as soon as I use the local IIS for running the application I get an error saying that the site (which I am trying to connect to) is refusing the connection.
But there has nothing changed right? I have not changed my code at all!
EDIT: My understanding is that the IIS and VIsual Studio's "On-The-Run" IIS are in base the same. But why are they acting so different here?
Web applications in a production environment are hosted using Microsoft's IIS web server software. In the development environment, however, the application may be hosted using IIS or the ASP.NET Development Server. Ideally, the same web server software should be used in both environments because using different software adds another variable in the mix. However, the ease of use of the ASP.NET Development Server makes it an attractive choice in the development environment. The good news is that there are only a few fundamental differences between IIS and the ASP.NET Development Server, and if you are aware of these differences you can take steps to help ensure that the application works and functions the same way regardless of the environment.
Visual studio uses IIS Express to host your application, which is a lightweight, self-contained version of IIS. It is used by developers to develop and test websites inside the same machine(localhost). The major difference between IIS and IIS express is that IIS express doesn't accept request outside the localhost. while IIS accept the web request from any another machine inside the domain. SO in order to accept request from your application you have to deploy it to IIS not IIS express.

Visual Studio 2012 Performance Profiler not pointing to the application

I'm testing the performance of my C# application on Visual Studio 2012.
I used the Release build mode and opened the Performance Wizard on my application, but the performance Hot Paths is pointing to the System dlls (atidxx32.dll) but not to the code of my application.
Are they any specific steps that I need to do so that the profiler will look into the performance of my web application and not the system?
I did some researches and found that the Web configurations of my ASP.NET web application are set to use Visual Studio Development Server and not IIS Express.
I changed the configuration and all went very well, the Sampling mode of the performance profiler is now profiling my application properly.
Go to Proprieties of the web application project / Web / Servers, tick Use IIS Express.

Using C# within IIS7

I'm very new to IIS7 and somewhat new to C#. My project right now is to use C# and IIS7 to create an interactive website with various clickable items and features. The C# programs are written and working properly, however I honestly do not know much about IIS7 despite trying to research it for a good amount of time.
My question is, how do I integrate C# scripts into ISS7 so that the website can be hosted with said scripts running smoothly within it? In other words, how do I combine the powers of ISS7 and my C# code to make a website? What must I do within ISS7 to utilize my C# code?
I've already "created" my new site within IIS7 and given it the appropriate bindings. I'm just not sure where to go from here.
I realize this may be a broad question/answer, so pointing me to where information on this topic can be found would also be greatly appreciated. I've searched through the official IIS website without much luck. Thank you.
It depends on what kind of code you want to run. The best start might be a straight forward web project, and not web services/web api.
Create a new web site project in visual studio, and hook it up with IIS in project properties-> web -> uncheck "Use IIS Express" and click "Create Virtual Directory". When you build the solution next time, it will be "deployed" to your local IIS.
A virtual directory maps to a physical directory on a computer. The web application will be running on your machine. If you have IIS on a web server that is not your development machine, then you have to deploy your web application to this server.
You might find this usefull: How to: Create IIS Virtual Directories in Visual Studio
The relationship between Visual Studio and IIS is that you can create virtual directories from Visual Studio. This means that when you visit localhost/MvcApplication1, IIS serves you the web application that is mapped in C:\Users\<Username>\Documents\Visual Studio 2012\Projects\MvcApplication1

Is it possible to deploy an ASP.NET application as desktop application (with server component)

Question: I created an ASP.NET web application.
Now it originally was meant for deployment on a webserver.
That is working, so, so far so good.
My question now is: Is it possible to deploy it as a desktop-application, too?
That is to say the installer installs some kind of server, plus the web application, configures the server to run this application on a localhost URL, and then creates a link in the start menu/desktop, where it opens that url (website, the application) on localhost in a web browser?
I think it should be possible, though the server wouldn't be IIS, because this is a windows component which can't be separately installed.
Is there anything like this already out there ?
The nonplusultra would be that it only starts the server when you click on the shortcut.
I'm not sure, but you could use IIS express, when it will be released. Take a look to ScottGu's post Introducing IIS Express.
I almost went for Cassini.
But in the meantime, I found something better:
http://code.google.com/p/aspnetserve/
My mistake was searching for 'asp.net deployment server component' instead of 'asp.net embedded webserver'.
A really cool project.
Seems to work, at least for my needs.
Edit:
A much better choice is xsp4 from package xsp-2.10.2, courtesy of the mono-project.
http://download.mono-project.com/sources/xsp/
Works on both Linux and Windows, as well as Mac, with both mono and .NET framework, and that without GAC installation (in fact, without any installation).
The latest source is here:
https://github.com/mono/xsp/tree/master/src
You can use an easily installable ASP.Net webserver such as UltiDev Cassini.
I think what you are looking for is something like Adobe Air: http://en.wikipedia.org/wiki/Adobe_Integrated_Runtime
However you want to be able to run ASP.NET, which Adobe Air does not. My suggestion is to use Silverlight

Categories

Resources