Not able to run Visual Studio Project - asp.net

Hi I don't know what I did, when I try to run visual studio project by pressing F5, I can see only loading symbol in browser but not displaying anything. When I checked whats going on, I got to know it is running on IIS Express and not on ASP.net development server.
What changes I should do to make my project to run on ASP.NET development server?

In the properties of your web project you can see the start options which has a server option.
Also if you right click your web project you can see option to use IIS express or dvelopment server.

Don't worry , this is not big issue .
Just open your csproject file into notepad.
And find this line in your csproject
<UseIISExpress>True</UseIISExpress>
Then change True to false
<UseIISExpress>false</UseIISExpress>
And save that ,then you can run your project .

Related

IISExpress shows up as host for browser in Visual Studio and messes up everything - how to get back to local?

All of a sudden after I installed Microsoft Edge on Windows 10 gd, Visual Studio is using IIS Express when debugging a web application and it is messing up everything.
How do I get back to normal, so that stupid IISExpress is not used anymore?
Go to the project settings and on the web tab is a drop down that allows you to choose which engine to use.
I went to Project > Properties > Startup Project and then set my start up projects to start the services I need and my project. This reverted my button back to just "Start".

Visual Studio 2017 crash when publishing web application

After updating my Visual studio to version 15.8.1 it has started to crash every time I try to publish a web application.
I try to use web deploy and fileSystem options, both crash. Changing the settings like unchecking delete unused files as no effect. Giving full permissions to the destination folder has no effect either.
Recreating the publish profile solved the issue. Something must have changed for pubxml file.

IIS Express giving a compilation error, denies access to files

I am running Visual Studio 2015 on Windows 7. I have a solution with 2 startup projects, both running on IIS Express, and the .NET version is 4.5.2.
Whenever I start the solution for the first time, everything works as expected. However, when I stop the application, make some changes to the source code, and restart, I get this Compilation Error -532462766 screen on startup :
The detailed compiler output is filled with lines like this:
/R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\268da2e1\665f7c6d\assembly\dl3\a9f1f009\c9360fff_0864d101\ServiceStack.Common.dll"
Going back to Visual Studio, and selecting "Clean Solution" gives me these unable to delete file messages (username and projectname removed).
The only way to get things working again, is to right-click IIS Express in the notification area, exit the process, then clean the solution in VS2015, and rebuild. Everything works again then, until the next time I need to change something in the source code (which happens quite a lot, being a software developer and all).
It seems IIS Express or Visual Studio, or my Windows user account is not allowed to delete files in IIS Express. I have tried running VS2015 and IIS Express in administrator mode, but no luck. What else can I try?

breakpoints in code behind not hit

common problem I guess, but no solution has worked so far:
my breakpoints (asp.net 2.0) get hit nicely in "backend" assemblies but not
in the code behind.
i can even see the
<% Response.CacheControl="no-cache"; %> line being hit in my asp.net master file
but still not the code behind.
I'm using VS 2005, windows 7 32 bit.
Any idea what else could I check?
If your code file is newer than the compiled version that is being run against (on the web server, whether it be IIS or the dev server), breakpoints will not be hit (the red circles will be hollow).
Try doing a clean / rebuild and see if that works.
EDIT:
I just noticed something in your last comment; you said you are attaching to the asp.net process. To which process are you attaching? It should be w3wp.exe.
My problem ended up being that I'd created a new configuration for the project, but that none of the debug properties on the project were set for it. So this is what I had to do:
Right click the web project and select Properties.
Go to the Build tab.
Click Advanced.
In the dialog, ensure that in the Output section, Debug Info is NOT set to none.
I'm guess there is a problem in loading the symbols for the page, and hence the breakpoint is not hitting,
try this
1 - While debugging in Visual Studio, click on Debug > Windows > Modules. The IDE will dock a Modules window, showing all the modules that have been loaded for your project.
2 - Look for your project's DLL, and check the Symbol Status for it.
3 - If it says Symbols Loaded, then you're golden. If it says something like Cannot find or open the PDB file, right-click on your module, select Load Symbols, and browse to the path of your PDB.
4 - I've found that it's sometimes necessary to
stop the debugger
close the IDE
close the hosting application
nuke the obj and bin folders
restart the IDE
rebuild the project
go through the Modules window again
Once you browse to the location of your PDB file, the Symbol Status should change to Symbols Loaded, and you should now be able to set and catch a breakpoint at your line in code.
hope it helps !
Answer source
Ugh. In my case I had mapped the right folder in IIS, but the application was set on IIS Express.
So the correct assemblies where loaded when I went to the URL, but the application was attached to a IIS Express version that never got any hits.
In my case I updated my repo from Git and the Project changed from Local IIS to IIS Express (Project > Properties > Web tab). This somehow messed up my configuration and I was not able to debug.
My problem was fixed by setting it to "Startup Project"
Solution Explorer -> Right Click on the project -> Set as StartUp Project
or
Menu bar -> PROJECT or WEBSITE -> Set as StartUp Project
Just to help others who come across this question, I too had this issue where none of my breakpoints where being hit.
It turned out that the project was originally created in Visual Studio 2015. I have 2008, 2010, 2015, 2017, 2019 installed. I accidentally opened it in 2017 and then this issue occurred. Opened it back up in 2015 and back to normal.

Project running on IIS

I have a web application that configured to run using IIS , but I don't have IIS currently installed on my machine and i don't want to change it
so can any one tell me how to change the .csproj file to run on the development server
Your project in Solution Explorer -> Right-Click -> Properties -> Web
Select "Use Visual Studio Development Server" option.
Save settings. Build and run your web application.
Or you can edit your .cproj file manually:
Open it in text editor
Find <WebProjectProperties> section ( most probably at the end of file)
Change <UseIIS>True</UseIIS> option to <UseIIS>False</UseIIS>
Save your file
You haven't said which version of Visual Studio you are using, but in VS2010, you right click your project, choose properties, go to the "Web" tab and finally check the "Use Visual Studio Development Server" radio button.
Thank you All for your help , I have found it , I edit the .csproj file , and change
<UseIIS>True</UseIIS>
to
<UseIIS>False</UseIIS>
Thanks very much

Resources