My computer has VS2008 and VS2013 installed. I have a website which was worked fine on VS2008. Recently I installed the VS2013 and update this website to be framework 4.5. I get the empty string of the User.Identity.Name in VS2013. I found some answer at HttpContext.Current.User.Identity.Name empty when debugging in visual studio
I have on webconfig. Also I make sure that I have the Windows Authentication component installed and activated in IIS. But I didn't see the Use Visual Studio Development Server in the "Properties" page. I only had option to use default Web Server.
Does anyone tell me how to fix it. Thanks in advance.
The below is my code for debug.
Dim Username As New User(User.Identity.Name)
I found the answer from [Authentication issue when debugging in VS2013 - iis express][1]
there is answer
In VS2013 F4 on your project to view properties window and disable Anonymous access and enable "Windows authentication"
Related
I've installed Visual Studio 2019 and uninstalled Visual Studio 2017.
Now if I start an ASP.NET (Core) site with https, it always say on Chrome:
This site can’t provide a secure connection
or on Edge
Can’t connect securely to this page
Screenshots:
Chrome:
Edge:
The URLs are correct. This also the same http://localhost:56784/ (it redirects to https)
Tried
What I've tried:
Updated Visual Studio 2019
Create a new ASP.NET Core 2 website
Tested with a ASP.NET site (non core)
Remove IIS certificates with MMC
Checking/changing the IIS settings in Visual Studio 2019 (project properties with context menu and project properties with F4)
Searching on Stackoverflow & Google ;)
Repair Visual Studio 2019
Issue
I think the issue is introduced by:
Installing Visual Studio 2019 and/or,
Uninstalling Visual Studio 2017 and/or,
Updating Windows 10 (current Version: 10.0.18362 Build 18362)
The underlining issue looks like a wrong/old/not supported TLS version?
Question
What can I do to diagnose/fix the problem?
Just as it did not work for #Nosnetrom - repairing IIS 10.0 Express did not work for me either. As #Julian mentioned my problem was caused by uninstalling VS 2017 as well.
This is what did not work for me:
uninstalling / re-installing VS 2019
installing VS 2017
uninstalling / re-installing / repairing IIS 10.0 Express
This is what worked for me:
after reading this advice - I realized that I was using port 51542 instead of a port in the range of 44300 through 44399
then I updated the applicationhost.config file according to this advice. The location of said file on my Windows 10 machine is: C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer\applicationhost.config. I had to open that file in Notepad ran as an administrator otherwise I could not save these changes:
then in Visual Studio I created a new virtual directory
that seemed to have done the trick for me - when I ran the application it worked
Repair of IIS Express fixed my problem:
For those who all the above methods didn't worked:
open a command prompt and then run:
dotnet dev-certs https --clean
and then:
dotnet dev-certs https --trust
None of the above solutions worked for me, Following steps worked for me.
Go to chrome or edge browser and type chrome://net-internals/#hsts
search for localhost in query domain, you will find lists of domain including localhost. Now delete the domain
Delete the domain by typing localhost
Just follow below steps:
Close Visual Studio
Delete .vs folder
Restart Visual Studio
Build and Run the Application
As per my understanding, .vs folder keeps the old settings inside the applicationhost.config file. So better to delete all cached settings and start with fresh.
None of this worked for me. What did work (and it's not as drastic as the other answers)...
Go into web project and set Start URL and Project URL to this: https://localhost:44365/
Save (but don't run the Project).
Edit .vs/[ProjectName]/config/applicationhost.config and change the bindings for the web project to this:
<binding protocol="https" bindingInformation="*:44365:localhost" />
<binding protocol="http" bindingInformation="*:53269:localhost" />
Reopen Visual Studio and when I started the website it worked.
I solved this problem as follows;
run the web project in debug mode on Visual studio 2019.
if it's on chrome you should do this ;
In my case use SSL check box was gone in debug section of project properties. everything was fixed by checking again
Right click on the project, select Properties, 'Debug', check the checkbox "Enable SSL", that's it, worked with me by doing this
If you 'are using services.AddHttpsRedirection like
services.AddHttpsRedirection(options =>
{
options.RedirectStatusCode = (int)HttpStatusCode.TemporaryRedirect;
options.HttpsPort = Configuration.GetValue<int?>("https_port", null);
});
Make sure HttpsPort is null or a valid port in appsettings.json or appsettings.Development.json file.
Clear your browser history and cookie
Issue
I have a .net 4.0 Web Application running in visual studio 2012, every time I go to debug the site i'm receiving the following error:
The Web Server Could Not Find the Requested Resource
What I've tried
I've followed microsoft's website with solutions: msdn
From a command prompt window, run the following command: systemroot\Microsoft.NET\Framework\ versionNumber \aspnet_regiis -i
I've also attempted to remove the .csproj.user files
Since we use Source Control i've deleted all items, the site and apppool and reconfigured from scratch.
AppPool is set to allow 32-bit applications
All to no avail...Anyone have a solution that might solve this visual studio debugging nightmare for me?
Steps:
Close all solutions in Visual Studio
open IIS7 (run > inetmgr)
Click your top node (computer name)
Open the "ISAPI and CGI Restrictions" option
check if your .Net version has the correct restriction (for example, if you're working with 4.0 is should be on "Allowed")
I was getting the same error when i was running the ASP.NET project from the IIS. I resolved this issue by configuring IIS.
Go to run
type appwiz.cpl and press enter.
Look for "Turn windows features on or off" and click on it
now windows will open for Turn windows features on or off
look for Internet Information service and select that option.
go to world wide web service under the Internet Information service branch
expand Application development feature
Select all the ASP and .net version. and click on OK.
now try running the application from asp.net , it will work :)
I had the same symptoms but a completely different problem. I had attempted to install Url Scan and it didn't seem to work correctly as I could not find the .ini file to edit settings within. I had forgotten that I had installed it, but it appears by default it will prevent debugging from working.
Uninstalling Url Scan solved the issue for me. To uninstall it I had to right-click on the .msi file and choose Uninstall. Url Scan did not show up under the "Add or remove programs" section.
My VS2010 debugger has stopped functioning suddenly today on my Dell M4500. I had reinstalled VS2008 SP1 last week, but the 2010 debugger ran fine since then, so I'm not sure its the culprit.
I can launch a project once just fine, & afterwards I get a message that reads "Unable to start debugging," without any error # or explanation of why. Doing IISRESET doesn't help, I get the same message until I close VS with the entire solution and reload it. Here are some things I've tried:
Verified I have the latest project files
Repair option for VS2010
Complete uninstall/reinstall VS2010
Replaced Web.config with known good copy
Added localhost to the list of trusted sites in IE
Performed \aspnet_regiis -i in the 2.0 & 4.0 directories
Through IIS Services Mgr -> Default Website:
verified Enable HTTP Keep-alives checked
placed check in Integrated Windows authentication
Ensured Debug on "Any CPU" is selected
Tried building to Platform targets "Any CPU," "x86" & "x64"
Added DisableLoopbackCheck registry key entry in
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Tested under both IIS & VS Development web server
Does anybody have any suggestions I can also try? Any help is very greatly appreciated!
Just a side note. I got a similar error in VS2013 trying to attach to chrome the error was:
Unable to attach the application 'chrome.exe' using XXX The 32 bit
version of the visual studio remote debugging monitor (msvsmon.exe)
cannot be used to debug 64 bit processes or 64-bit dumps. Please use
the 64-bit version instead
I had to untick "Silverlight" in the web project Web section:
I received this same message, preventing my web project from running and opening in a browser. Turns out another developer had made a change in the project properties to "Use Custom Web Server" which pointed to an external URL instead of to the web server on my machine.
Try this:
Right-click your project in Solution Explorer - click Properties - click Web tab - under Servers click "Use Visual Studio Development Server". For reference the usual port value here is "Auto-assign Port". Best of luck.
Here's why I got this error.
In Debug properties, verify that Start external program is not empty.
VS 2010 will warn you about it being empty, but will let you save it
I was trying to switch it from IE to Chrome, lost track of changes I was making, and spent an hour trying to figure out where this error was coming from.
I had the same issue but it worked when I switch Build => Platform target from x64 to x86.
Kindly turned off Debug Edit and Continue option
Turn on vs2010, run debug.
turn off debug, shut down all lunched webServers (i had few of them for different services)
Turn off VS2010
Turn on VS2010.
After that everything works perfect.
I have installed VS2010 SP1 and IIS Express Beta. Both are installed correctly, but I can't use them because the option does not appear in the context menu as Scott Guthrie describes on his blog here:
http://weblogs.asp.net/scottgu/archive/2011/01/03/vs-2010-sp1-beta-and-iis-developer-express.aspx
What am I doing wrong? What should I do to activate IIS Express?
Final version of IIS Express has been released last week. You didn't mention which Beta are you using, but you would be better off with the final version.
Your Visual Studio 2010 SP1 version (as shown in the Help/About) should be 10.0.31118.1 SP1Rel.
You could check if IIS Express works on it's own by going to it's installation directory (in Program Files and trying to run iisexpress.exe (should start a sample site WebSite1 on port 8080).
“Converting your existing projects to use IIS Express is really easy. You can do this by opening up the project properties dialog of an existing project, and then by clicking the “web” tab within it and selecting the “Use IIS Express” checkbox.” — do you have that checkbox?
Here is my environment
Windows7, Visual Studio 2010, MVC2.0 and NET4
My default web site is configured to use ASP.NET v4.0 application pool.
Here is an easy way to reproduce my problem
Create a new MVC2 application
Open the properties Window
Go to the Web tab
Check "Use IIS Local Web Server"
Click on "Create Virtual Directory" button
I get this error message
To access local IIS Web Sites, you must install the following IIS components:
In addition, you must run visual Studio in the context of an Administrator account
For more information, press F1
Notice the blank line after "...the following IIS components:"
I am running VS2010 as administrator
Pressing F1 does not bring any help
I checked my Windows eventlog files and found that my metabase was corrupted
(I thought we get rid of this in IIS7 but it looks like it is still here...)
I used this Microsoft article to restore it from an old version and now everything is working
Hope this can help somebody else
Have you tried running VS as administrator?
Right click your VS shortcut and select "Run as Administrator"
I had the same error message, in my case with VS2008, Windows 7 + IIS7, when trying to add an existing web site to a solution. I think this is one of those error messages where what it states can be a big red herring, i.e. it doesn't necessarily have anything to do with running as an administrator or not having components installed.
In my case, the web site had an HTTP binding in which the hostname was set to "localhost". Once I cleared that, it worked fine. Don't ask me why I put "localhost" in there, it just seemed to make sense at the time.
My internet hunting also turned up this brief entry, which did not work for me.