Visual Studio 2015, Windows Authentication, and IIS Express

[Origin]: http://provenstyle.com/blog/2015/10/02/Visual-Studio-2015-Windows-Authentication-And-IIS-Express/

I finally upgraded my Visual Studio to 2015 and the transition has been pretty smooth! However, today I had an issue that took me a little while to solve. An Asp.net MVC web app that uses Windows Authentication, had been working great, but was suddenly gave me the following error:

Access is denied.

Description: An error occurred while accessing the resources required to serve this request. 
The server may not be configured for access to the requested URL. 

Error message 401.2.: Unauthorized: Logon failed due to server configuration.  
Verify that you have permission to view this directory or page based on the credentials 
you supplied and the authentication methods enabled on the Web server.  Contact the Web 
server's administrator for additional assistance.

I learn several things trouble shooting this. The first is that IIS Express configuration has moved from C:\Users\YourUserName\Documents\IISExpress\config\applicationhost.config out of the My Documents IISExpress folder and into the new .vs/configuration folder.

The second thing I was reminded of is that there is another place to edit properties for your project. I almost never press f4 on my project. I right click and go down to properties, but that is a very different set of properties than you get when you press f4.

The solution to my authorization issue was to go into the f4 project properties and set the following:

Anonymous Authentication – Disabled

Windows Authentication – Enabled

Apparently these properties update the IIS applicationHost.config directly. It adds the following to the config.

<location path="Project.Name.Here">
    <system.webServer>
        <security>
            <authentication>
                <windowsAuthentication enabled="true" />
                <anonymousAuthentication enabled="false" />
            </authentication>
        </security>
    </system.webServer>
</location>

It is irritating that you can’t save these somewhere in the .csproj file instead, but not a big deal once you know it is there.

Advertisements

SQL71508: The model already has an element that has the same name ABC_Role

[Origin]: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/25266466-cc27-4e60-a18f-22673e6507e8/sql71508-the-model-already-has-an-element-that-has-the-same-name-abcrole?forum=ssdt

Hello,

I am trying to  convert a VS2010 database project to a VS2012 database project. This database has a case-sensitive collation. But VS2012 seems to be ignoring the collations and complains about two objects with same name (in different case) to exist, in the same project.

For example, I have 2 database roles ABC_Role and Abc_Role. In ths case sensitive project, they should be recognized as 2 different roles but VS2012 database project doesn’t seem to like it. I tried to see if the same happens with tables too. And it behaves the same way. I tried messing with “Validating casing on Identifiers” setting on the Project Settings window, but that didn’t work.

Is there a way to make SSDT recognize the collation? Any help is appreciated.


Hima, To help the community better identify relevant thread, please don’t forget to mark as answer or vote as helpful if and answer helps.

Tuesday, April 16, 2013 8:27 PM
Avatar of Hima Nagisetty
Scottrade Inc

OK, I can repro this when converting a dbproj to a sqlsproj, but not when creating a new sqlproj and adding the objects.

The problem is in the upgraded project file. Open the .sqlproj project file and make sure that the ModelCollation is set to CS, this is what was the diff for me when upgrading:

<ModelCollation>1033,CS</ModelCollation>

To be sure, also check that:

<ValidateCasingOnIdentifiers>False</ValidateCasingOnIdentifiers>

<DefaultCollation>SQL_Latin1_General_CP437_BIN</DefaultCollation>


-GertD @ http://www.sqlproj.com

  • Marked as answer by Hima Nagisetty Thursday, April 18, 2013 8:55 PM
Thursday, April 18, 2013 8:25 PM
Puppet Lab

IIS does not list a website that matches the launch url

[Origin]: https://stackoverflow.com/questions/10716956/iis-does-not-list-a-website-that-matches-the-launch-url

I need to debug the website i ‘m developing (ASP.NET MVC3, Razor, .NET 4, VS2010 SP1 (as administrator)) in IIS7 (Vista Home) and getting the error:

IIS does not list a website that matches the launch url.

To test if it has to do something with the settings of the app, i did create from scratch an empty new ASP.NET MVC3 website, set for IIS, created virtual directory, launched with F5 and i worked fine!

I again did create a second website project with the exact same settings (just to be sure) and this also launched as expected.

This leads my to think that i have some configuration problem!? But what? In the past i used IIS very rare, so my knowledge is somehow limited in this direction.

Any hints?

shareedit

I hate answering my questions: in my question i stated that i was running VS under the administrator account. This was not true!!!

So the solution (for me) was to run VS2010 as administrator (Start->In Vista menu right click-> Run as administrator)…so simple.

As a side effect: VS2010 let me also create Virtual Directories without any problems (prior to that i got error messages stating that i have to manually adjust these)

shareedit

Stop Visual Studio from launching a new browser window when starting debug?

[Origin]: https://stackoverflow.com/questions/716494/stop-visual-studio-from-launching-a-new-browser-window-when-starting-debug

I already have a window open with the web site I’m debugging. I don’t need VS to launch another one for me every time I need to debug.

Is there a way to stop this behavior?

shareedit

Open your startup project’s properties (Project->{ProjectName} Properties… from the main menu or right click your project in the Solution Explorer and choose Properties), then navigate to the Webtab and under Start Action choose Don’t open a page. Wait for a request from an external application.

You will still be able to use any browser (or Fiddler, whatever) to access the running application, but it won’t open the browser window automatically, it’ll just start in the background and wait for any requests.

shareedit

Running two projects at once in Visual Studio

[Origin]: https://stackoverflow.com/questions/3850019/running-two-projects-at-once-in-visual-studio

I created a solution in Visual C# 2010 Express that contains two projects: one is the client, the other is the server. I would like to debug both at the same time, but I can only seem to run one of the projects during debugging.

Is there a way to run both at once?

shareedit

Go to Solution properties -> Common properties -> Startup Project and select Multiple startup projects.

solution properties dialog

shareedit

Max has the best solution for when you always want to start both projects, but you can also right click a project and choose Debug > Start New Instance.

This is an option when you only occasionally need to start the second project or when you need to delay the start of the second project (maybe the server needs to get up and running before the client tries to connect, or something).

shareedit

“The breakpoint will not currently be hit. The source code is different from the original version.” What does this mean?

[Origin]: https://stackoverflow.com/questions/2468852/the-breakpoint-will-not-currently-be-hit-the-source-code-is-different-from-the

When debugging in Visual Studio, sometimes I add a breakpoint but it’s hollow and VS says “The breakpoint will not currently be hit. The source code is different from the original version.” Obviously this prevents me from being able to debug.

What on earth does the message mean? What original version? If I’ve just opened up the solution and not made any changes whatsoever to the code, how can there be an ‘original version’?

shareedit

As it says, the “source code is different from the original version”.

Right click on the project folder inside the solution explorer and choose to Clean. Build a new version of the project and the breakpoint will work again!

shareedit

Select Debug in Solution Configurations, instead of Release

screenshot of menu

shareedit

If you have more than one projects in your solution, then make sure that the correct project is set as the StartUp Project. To set a particular project as the Startup Project of your solution, Right-click the project, choose Set As StartUp Project.

After I set my StartUp Project correctly, desired break-point was reached by the thread.

shareedit

Client authentication error when starting Visual Studio 2015.3

[Origin]: https://stackoverflow.com/questions/38516736/client-authentication-error-when-starting-visual-studio-2015-3

I just performed a clean install of VS2015.3 and I’m getting this in the Output window at startup:

We were unable to automatically populate your Visual Studio Team Services accounts.

The following error was encountered: TF400813: Resource not available for anonymous access. Client authentication required.

I’m not using VSTS at all, nor have I configured any connections to it. (I do, however, have a connection configured to an on-premises TFS instance.)

How may I dispense with this error message? I’d like to instruct Visual Studio to never attempt a connection to VSTS at startup.

shareimprove this question

In the top right corner of Visual Studio, you will find a colored box with your name or your initials inside. click the down arrow and then Account Settings. In the opening window, please click “Sign out” in the upper left part of the window.

After a restart of Visual Studio and signing back in, the error should be gone.

shareimprove this answer