Visual Studio 2013 - IIS Express not serving aspx files - c#

I was compelled by work to upgrade from Visual Studio 2010 to Visual Studio 2013. In VS 2010, I used the built-in host for viewing .net apps locally and everything worked just fine. Visual Studio 2013 dropped support for the built-in host and compels everyone to use IIS Express.
My trouble is that IIS Express won't serve up "[anything].aspx" no matter where in the folder tree of the project it resides. I created two test files in the root of the project: HelloWorld.html and HelloWorld.aspx (c#) and made both to simply show a page saying "Hi" with the asp.net file showing the current date and time. I then copied these two test files into an arbitrary folder in the project. After building the project (unnecessary, I know), I did a "View in Browser" for all test files. In all cases, the HTML files displayed properly. The aspx files cause a "HTTP 400 Bad Request" / "The webpage cannot be found" error.
I've prowled Stack Overflow and Google and read about some near-misses but ultimately came up empty for this specific problem. I'm hoping this is a simple configuration issue, but the answer so far eludes me. Thanks in advance for your kind assistance!
Edit:
Thanks to Lex Li's suggestion of using the Jexus Manager to see what's going on with the IIS Express configuration, it shows that zero apps are assigned to any of the default application pools. Correspondingly, when clicking on the home of the website in the Jexus Manager, the .Net section of the website is absent.
Edit #2:
The web app is assigned to one of the default IIS Express app pools: Clr4ClassicAppPool.

Sound weird, did you try open the iis express xml applicationhost.config and check there the mime type or the application pool settings?

Related

Static files on local machine not being published to IIS from visual studio

this is about the first time I am trying to publish my first ASP.NET application to IIS on my local machine.
I have gone through some guiding resources to be able to do that. I have installed both IIS and SQL Server Express on my local machine. I have been able to publish it and it is running on localhost/appname.
The problem however is that the static files - CSS, JS and images are not being published to IIS. So the application displays without styling, without images and without JavaScript. I have gone through Control Panel and ensured that Static Content is checked in the Commom Http Features category and still the problem persists. I have even copied the files manually from the development directory to the Content directory in IIS and still the problem persists.
I am running Windows 10, ASP.NET 4.6, Visual Studio 2015 Community Edition Update 1
I would really appreciate any guide to solving this problem.
Thank you all
You must ensure that your static files are a part of the solution to have them included in the publish.

Visual studio web, what file do i upload to server?

I'm a little confused, since a day or 2 i've been programming with visual studio 2013 web express. i've made a C# web form (.aspx). i used to program normal html/css in Adobe Dreamweaver.
But unlike a normal .HTML document i cannot find a file to just click and open in my browser. and so i do not know how to upload my project to my hosting server. when i debug it, it shows up in my browser and it tells me it is the file with .aspx extension but when i try to manually open this file it just tells me there's something wrong with my page (incorrect code etc.)
Anyone can tell me how i do this? could not find a solution in google so i thought i'd give stackoverflow a chance :)
Thanks!
Gr.
First off, a website programmed with ASP.Net requires Internet Information Services (IIS) to run.
Visual Studio has its own built-in mini version of IIS for development, but to deploy to production you'll need a Windows Server with IIS. You should check that your hosting provider supports IIS before you do anything else.
Assuming you have IIS running, and you've configured a website in IIS with an empty directory, ready to host your project there are a couple of different options you have for deployment:
Just copy everything in the website to the server (all files & folders). This is simplest, and allows you to tweak things on the fly, but is the least secure.
Use Visual Studio's packaging and deployment utility. Not much to say here, other than read the manual.
The .aspx pages, .ascx controls, the bin folder with your .dll files, web.config, App_Themes, App_LocalResources, etc. And then you'll need to set up a new web site on IIS.

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

Cannot open an old ASP.NET 1.1 application (solution) in VS 2003

I have a Problem with an very old ASP.NET 1.1 application. I cannot open (load) it in Visual Studio 2003 (on a Win 2003 server) any more. I get an error message,that the component for the communication with the "Front Page - Server Extensions" cannot be found (I use a german VS 2003, so I have not the exact English message). The extensions are installed. That can be the reason for that respectively how can I solve this problem.
Another Question: Is there a possibility to open an ASP.NET 1.1 application in VS 2010? Tthe upgrade wizard tries to convert it, but the conversion results in errors.
If I remember correctly you need to create a virtual directory in IIS that maps to the directory containing the ASP.NET project - you may need to tweak the solution file in the process so the ASP.NET project path matches your IIS virtual directory path(e.g. http://localhost/VIRTUALDIRECTORY/ASP.NETProject.csproj).
Ensure any .suo and .webinfo files within the solution and project folders are deleted before opening the "tweaked" solution file.
"Cannot find the components for communicating with FrontPage server exstensions". I believe this might be the error message.
Logon as another user and see if 'they' get the same problem. If the problem goes away as a different user. Destroying your local profile and then rebuilding it. Remember to back it up first as you will lose everything associated with this profile.
If that doesn't work then you should try the following (It concerns removing Beta 2 of VS 2002/2003, but the line that interested me was): http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q312383
Hope that helps.

Trying to deploy clickonce app to FTP site but getting FrontPage Server Extensions not installed Error

I'm trying to deploy a WinForm app through clickonce using a ftp site on my dreamhost account. However, when I try to publish, I get the following error:
Failed to connect to 'ftp://ftp.mydomain.com/client' with the following error: Unable to create the Web site 'ftp://ftp.mydomain.com/client'. The components for communicating with FrontPage Server Extensions are not installed.
Here is my settings on the publish tab
Publishing Folder Location: ftp://ftp.mydomain.com/client
Installation Folder URL: http://ftp.mydomain.com/client
It seems that Visual Studio is not realizing I am publishing to a ftp site and not a site with FrontPage.
Does anyone know how to fix this problem?
Visual Studio only supports publishing to web servers that have Frontpage Extensions installed, regardless of whether connecting via FTP or HTTP. If your host doesn't support them, you will have to publish to a local folder and then upload its contents using an FTP client.
UPDATE: The FrontPage extension components need to be installed on the machine you are DEVELOPING on (Used to publish). The server shouldn't matter--it's simply FTP. On your development system, go to control panel > add/remove programs > and repair "Microsoft Visual Studio Web Authoring Component". Depending on the version you have, you may need to repair VS2010, etc. This will reinstall the FP components on YOUR machine, allowing you to publish via FTP.
Do you recently installed Xamarin extensions xamarin.visualstudioInstall.msi ?
This is cause of stopped deployment component.
Check this discusion:
http://forums.xamarin.com/discussion/30406/bug-after-installing-xamarin
Removing 'Xamarin' from the uninstall/change a program fixed the issue for me.
After that VS 2013 and VS 2015 RC1 deployments started to work again.
what is worth of acknowledgment is the fact that Visual Studio 2010 may report such error due to problems with lacking RAM or after several sleep or hibernation phases with VS turned on. I experienced this with a perfectly well configured server which I have used for ages and done hundreds of publishes, the error came all of a sudden and the only medicine was a VS restart (or sometimes the whole machine's restart). Best regards.
According to MSDN specs, you'll have to add some custom content/mime types to your server for ClickOnce:
If you are deploying a ClickOnce application from a Web server
other than IIS, you may experience a problem if the server is
returning the incorrect content type for key ClickOnce files, such as
the deployment manifest and application manifest. To resolve this
problem, see your Web server's Help documentation about how to add new
content types to the server, and make sure that all the file name
extension mappings listed in the following table are in place.
File name extension Content type
=================== ===========================
.application application/x-ms-application
.manifest application/x-ms-manifest
.deploy application/octet-stream
.msu application/octet-stream
.msp application/octet-stream
DreamHost allows you to add custom mime types in a .htaccess file.

Categories

Resources