browser shows a blank screen when an asp.net core mvc application is run - asp.net-core

I have created an asp.net core mvc web application in visual studio 2019 professional edition. After a successful build when I run the application, I am getting a blank screen in the browser. It is not showing the contents of the index page.
I checked the iis by typing inetmgr in the command window. It is opening up the iis Window. I also cross-checked in the browser window by typing http://localhost/. I am able to get the welcome page in IIS.
I don't know what's the issue here. Any valuable help is appreciated.
Please find the screenshot below.

When I faced a similar issue, it was due to the Web.config file, when the run httpRuntime was set to an incorrect target framework. Maybe remove the targetFramework parameter and see if the auto resolver resolves it.

Related

ASP.NET Core 3.1 app on IIS Express: “This site can't be reached” and "The connection was reset"

I have developed ASP.NET project in Visual Studio 2019. When I try to run the project with IIS Express, the webpage says “This site can't be reached” and "The connection was reset".
In taskbar I can see that IIS Express is working and I'm able to debug and step though my code till the very end successfully so I know the service is executing fine without any errors.
Site can`t be reached
I created a new project, just to ensure that there weren't any errors within my config or build files. When I run the new project, I get the same result.
I tried with other browsers as well, but still the same error.
I repaired the Visual Studio using the Visual Studio Installer, and reset everything to default, and had no success with that.
I tried to delete hidden vs. folder and had no success.
Any advice on how to resolve this would be greatly appreciated.
Thanks!
I fixed the issue by deleting Kaspersky Antivirus.

Attach to MVC 6 process in IIS

I am hosting an asp.net 5/mvc 6 application in local IIS using dnx x64 1.0.0.rc1. I would like to attach to the iis process and debug my application, but no symbols are ever loaded for the classes that I set breakpoints in.
Is this possible with this version of dnx and IIS?
If so, how do I attach to the iis process with symbols loaded?
---UPDATE
So I've tried attaching to dnx.exe, but still no luck. Strangely, I was able to get this to work one time, but cannot replicate it again. So if anyone can outline the steps required to debug MVC 6 on IIS, please post here.
What process are you trying to attach to? I believe you should be attaching to dnx.exe

Kestrel / IIS Express requires restart before edited .cshtml view changes are shown in browser

I'm in the process of setting up my first ASP.NET vNext web application project.
I've got as far as getting the default project to build and run fine in both Windows and OSX. I've tested with kestrel on the mac, and in Windows IIS Express along with kestrel.
The problem I have encountered is that in Windows, editing a cshtml View file while the web server is running isn't reflected when I next refresh the browser.
In OSX, I can run 'dnx web' and navigate to localhost:5000 and browse the site. I can then edit the .cshtml View files, switch back to the browser, hit refresh, and I can see all the changes. This is what I expect to happen and happened in previous versions.*
In Windows, I can either run dnx web or IIS Express on the same site as I was using on OSX, navigate to localhost:5000 (or for IIS Express its own port number) and browse the site. I then switch to edit the cshtml View files, but when I switch back to the browser to reset, the changes aren't shown. It's not until I restart kestrel or IIS express that the changes are shown.
Curiously, however, I can edit a .cs Controller file and the site then recompiles by itself and I don't need to re-start it - in Windows at least. (In OSX, editing a controller file doesn't cause an auto-recompile, but that's an aside, I believe dnx-watch will fix that).
Is there something that I've missed in the project.json, or another setup file, which is causing the issue in Windows?
I have tried:
creating a second completely clean web application project
reinstalling ASP.NET
desperately, lastly, creating a clean install of Windows 10 with Visual Studio 2015 Community Edition, to no avail
What's the way to get Kestrel or IIS Express in Windows to serve the updated cshtml View file after it's been edited, without restarting the server?
*side note, ASP.NET MVC in OSX is awesome!
Following on from #SRQ Coder's response, in particular the reassurance that it's supposed to work as I hoped, I found the reason but as yet no decent solution.
My project directory is located on a network share and I load the projects directly from there (I run Parallels Desktop on a mac). This works great with ASP.NET 4.x / MVC 5 (and earlier). However it looks like ASP.NET 5 doesn't support this setup.
The moment I copied the project folder to the local C: drive it all worked fine
When opening the project from a \\network-share, the project loads and I can run/debug the website, but CSHTML edits aren't shown in browser until IIS Express/Kestrel is restarted
Opening the project from a X:\ mapped network drive doesn't make any difference
I'm not able to recreate your problem on my machine: VS2015; Win10 etc. in either the IIS mode or Web: localhost/5000 mode and on multiple browsers.
I can edit both 'shared' cshtml files like '_Layout' and also the default 'home/index cshtml file with no problem.
Since you've re-installed so much of your system, I'm wondering if you have not re-installed web-essentials and enabled 'browser link'.
I feel your pain...

website text only when run it from iis manager

this is my first time using IIS Manager to deploy Website, I built my website using MVC 4 Visual Studio. When i run from Visual Studio this is the
view
but when i deploy using IIS Manager. this is the
view
Please help me.
CSS are not loading Please verify the path of CSS and js files. For more information please use inspect element in your browser .
This Solve, I open IIS Manager and Open Directory Browsing, at the right side, click enable.

How to disable WCF Test Client - VS 2012

I have a new WCF Service Application, when I hit F5 to debug, the WCF Test Client always comes up, but I would like to disable it since I am using soapUI to test instead.
I have tried the answer here - https://stackoverflow.com/a/8441887/903056 but this XML node is no longer in the project file for VS 2012. I have tried several other things myself as well, such as changing default start page and trying to force debug to start a browser session instead.
This is realy frustrated but you can try one of the followings to disable the WCF test client:
1.Open the requested project properties and select the Web tab. Select
the Current Page radio button (I believe that the Specific Page
button is selected), Save the project and run(F5).
2.You can modified the prject XML (.csproj) file and add
<EnableWcfTestClientForSVCDefaultValue>False</EnableWcfTestClientForSVCDefaultValue>
attribute to <WebProjectProperties> node. That should be done by the
followings:
2.1 Unload the requested project (right click -> Unload Project).
2.2 Edit <ProjectName>.csproj (right click again on the project)
2.3 Look for WebProjectProperties node and add <EnableWcfTestClientForSVCDefaultValue>False</EnableWcfTestClientForSVCDefaultValue> to it.
2.4 Reload the poject.
I hope you will find that unswer helpfull..
A simple option that works for me (at least in Visual Studio 2012 Update 4):
Open the WCF project properties and go to the Web section. Set the Start Action setting to Don't open a page. Wait for a request from an external application.
After choosing that option I no longer see the WCF Test Client.
I personally usually choose this start action anyway, since I much prefer hitting F5 in my browser than having yet another tab opened each time I hit F5 in VS.
I found a reasonable work around. All I did was add an empty html page to the project, then right clicked on the html file in Solution Explorer and chose Set As Start Page. A debug session starts but it doesn't go to the WCF TestClient. Not elegant but works.
Old thread but found it while I was suffering the same frustration with VS2013. If you run the project (F5) with the (yourProject)\svc.cs file open in the VS editor then the WCF Client starts. If you hit F5 with any other file as the selected and focused file in the VS editor then IIS and the normal first web page starts.
Very simple when one knows.
I had a similar problem, and found this to be caused by the default Start Options under
> Solution Properties
> Debug
>Start Options
>Command line arguemnts:
it was listing a command line argument of /client:"WcfTestClient.exe" which was launching the test client. Simply removing this argument solved my problem.
No need to extra thing just do thing below.
Tools-->Option -->project and solution-->Build and Run and finally
check Only startup project and Dependencies on Run