Visual studio update behind a proxy server - visual-studio

I'm using Visual studio 2015 inside our organization. I want to be able to use the Extensions and updates features but I always get a connection problem when I try to access the "online" or "update" section. We are behind a proxy server.
The problem is related to the configuration of the proxy because the feature work well if I connect my pc on a direct internet connection.
The proxy is managed by another organization and I don't know much about that subject.
I need help on what I should say so they understand what they need to change.
Does someone knows what configuration need to be put in place to make that VS feature works?
thanks

Assuming you're working on Windows, you can try to set the Proxy for VS in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy bypassonlocal="True" proxyaddress="http://proxy.bn.ch:8080" />
</defaultProxy>
</system.net>
This overrules the standard Proxy Settings from IE.

the answer of tk78 is correct but if you are behind a company proxy probably you need to add user, password and domain on the proxy address like this:
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy bypassonlocal="True" proxyaddress="http://domain%5Cusername:password#youproxyaddress:portnumber" />
</defaultProxy>
</system.net>
The '%5C' is the escape for '' .

Related

Possible to add iis express configuration (windows authentication) to asp.net mvc6 project?

Is it possible to setup an asp.net mvc6 application to run with windows authentication when debugging using IISExpress without having to edit the global iis express configuration file?
In visual studio 2013, you had the possibility to go to properties on your web application project and edit it from there. The changes resulted in some extra xml in the .csproj file with the information.
However, the .kproj file from asp.net mvc6 projects does not have the configuration listed.
I have tried to add the xml properties from vs2013 to the .kproj file which has had no effect.
Is this not yet implemented?
Right-click on ASP.net 5 / MVC 6 project and select properties.
On the left click on Debug.
At the bottom of the Properties->Debug page
uncheck enable anonymous authentication
check Enable Windows Authentication
In your controllers you'd put something like
[Authorize(Roles = "Domain\\Group")]
above the class or action methods
Yes, simply add your web.config file to your wwwroot directory with the IIS configurations that you want.
web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</configuration>

Basic Authentication on IIS Express

I've searched for a while now but I can't seem to find the answer. There are ways of disabling/enabling anonymous and windows authentication. Does anyone know how to enable basic authentication on IIS Express (8.0) in Visual Studio 2013?
Update ApplicationHost.config
In the the ApplicationHost.config file, find the following nodes and update the values:
<sectionGroup name="authentication"&gt
<basicAuthentication enabled="false" /> <!-- set to false -->
</sectionGroup&gt
<!-- ... -->
<authentication&gt
<section name="basicAuthentication" overrideModeDefault="Allow" /> <!-- set to allow -->
</authentication&gt
Locate ApplicationHost.config
VS 2015 and above (per Joost's answer):
sln_folder/.vs/applicationhost.config
VS 2013 and below:
%UserProfile%\Documents\IISExpress\config\applicationhost.config
As far as I know, there is no way to enable it for only one project.
An additional heads up, in Visual Studio 2015, the location of the applicationhost.config file that is actually being used is inside a folder called .vs inside your solution folder. The one in your user profile is not being used
Here are slightly more details than the previous answer had:
%USERPROFILE%\Documents\IISExpress\config\applicationhost.config:
<basicAuthentication enabled="true" />
In the same file: set
<anonymousAuthentication enabled="false" userName="" />
If you are not using domain test accounts, create a local user account with the password for the test login.

Adding <mimeMap> entry Causes 500 for Other Static Content on IIS Express

I'm using Visual Studio 2012 with Update 2 and IIS Express.
When I add a record to the staticContent section, all other static content (.js, .css, .jpg, etc) returns a 500 error.
Any advice would be greatly appreciated. Thanks in advance.
The mimetype is probably already added to your IIS.
Try to remove the mimetype first and then add it again in your web.config
<remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
Good luck!
Behavior of system.webServer/staticContent/mimeMap element has changed in IIS 7.0 and apparently one has to list all types explicitly to have them returned properly.
Here is a description from IIS configuration documentation:
Note: IIS 7 will not return file types that are not added to the element or that have mappings in the element by default. This behavior prevents unauthorized access to files that do not have mappings in the IIS 7 configuration settings.
If you are using IIS Express in visual studio then there is no need to define staticContent so remove it.
By default, Visual studio IIS Express allow all MIME types.

IIS Express Windows Authentication

I'm trying to use IIS Express with VS2010 to host a silverlight application. I modified my applicationhost.config file to allow for modification of the proper configuration settings. I have the following in my web.config:
<location path="">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</location>
I am not being authenticated and my domain service call returns a null record as the user. I was able to get this to work after installing VS2010 SP1 BETA but I'm trying to get this to work with only IIS Express.
How do I enable Windows Authentication to work with IIS Express. Is there a configuration setting that I am missing?
Visual Studio 2010 SP1 and 2012 added support for IIS Express eliminating the need to edit angle brackets.
If you haven't already, right-click a web-flavored project and select "Use IIS Express...".
Once complete, select the web project and press F4 to focus the Properties panel.
Set the "Windows Authentication" property to Enabled, and the "Anonymous Authentication" property to Disabled.
I believe this solution is superior to the vikomall's options.
Option #1 is a global change for all IIS Express sites.
Option #2 leaves development cruft in the web.config.
Further, it will probably lead to an error when deployed to IIS 7.5 unless you follow the "unlock" procedure on your IIS server's applicationHost.config.
The UI-based solution above uses site-specific location elements in IIS Express's applicationHost.config leaving the app untouched.
More information here:
http://msdn.microsoft.com/en-us/magazine/hh288080.aspx
option-1:
edit \My Documents\IISExpress\config\applicationhost.config file and enable windowsAuthentication, i.e:
<system.webServer>
...
<security>
...
<authentication>
<windowsAuthentication enabled="true" />
</authentication>
...
</security>
...
</system.webServer>
option-2:
Unlock windowsAuthentication section in \My Documents\IISExpress\config\applicationhost.config as follows
<add name="WindowsAuthenticationModule" lockItem="false" />
Alter override settings for the required authentication types to 'Allow'
<sectionGroup name="security">
...
<sectionGroup name="system.webServer">
...
<sectionGroup name="authentication">
<section name="anonymousAuthentication" overrideModeDefault="Allow" />
...
<section name="windowsAuthentication" overrideModeDefault="Allow" />
</sectionGroup>
</sectionGroup>
Add following in the application's web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</configuration>
Below link may help:
http://learn.iis.net/page.aspx/376/delegating-configuration-to-webconfig-files/
After installing VS 2010 SP1 applying option 1 + 2 may be required to get windows authentication working. In addition, you may need to set anonymous authentication to false in IIS Express applicationhost.config:
<authentication>
<anonymousAuthentication enabled="false" userName="" />
for VS2015, the IIS Express applicationhost config file may be located here:
$(solutionDir)\.vs\config\applicationhost.config
and the <UseGlobalApplicationHostFile> option in the project file selects the default or solution-specific config file.
Building upon the answer from booij boy, check if you checked the "windows authentication" feature in
Control Panel -> Programs -> Turn windows features on or of -> Internet Information Services -> World Wide Web Services -> Security
Also, there seems to be a big difference when using firefox or internet explorer.
After enabeling the "windows authentication" it works for me but only in IE.
In addition to these great answers, in the context of an IISExpress dev environment, and in order to thwart the infamous "system.web/identity#impersonate" error, you can simply ensure the following setting is in place in your applicationhost.config file.
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</configuration>
This will allow you more flexibility during development and testing, though be sure you understand the implications of using this setting in a production environment before doing so.
Helpful Posts:
http://forums.iis.net/post/1873372.aspx
http://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/aspnet-20-breaking-changes-on-iis
In IIS Manager click on your site.
You need to be "in feature view" (rather than "content view")
In the IIS section of "feature view" choose the so-called feature "authentication"
and doulbe click it.
Here you can enable Windows Authentication.
This is also possible (by i think in one of the suggestions in the thread) by a setting in the web.config ( ...)
But maybe you have a web.config you do not want to scrue too much around with.
Then this thread wouldnt be too much help, which is why i added this answer.
This answer may help if: 1) your site used to work with Windows authentication before upgrading to Visual Studio 2015 and 2) and your site is attempting to load /login.aspx (even though there is no such file on your site).
Add the following two lines to the appSettingssection of your site's Web.config.
<add key="autoFormsAuthentication" value="false" />
<add key="enableSimpleMembership" value="false"/>
On the same note - VS 2015, .vs\config\applicationhost.config not visible or not available.
By default .vs folder is hidden (at least in my case).
If you are not able to find the .vs folder, follow the below steps.
Right click on the Solution folder
select 'Properties'
In Attributes section, click Hidden check box(default unchecked),
then click the 'Apply' button
It will show up confirmation window 'Apply changes to this folder, subfolder and files' option selected, hit 'Ok'.
Repeat step 1 to 5, except on step 3, this time you need to uncheck the 'Hidden' option that you checked previously.
Now should be able to see .vs folder.
After doing everything in the above answers, I figured out I was not running Visual Studio as Admin. After running as Admin, problem solved.
If none of the answers helps, you might need to adjust the project properties. Check this other StackOverflow answer on how to do that:
https://stackoverflow.com/a/20857049/56621
I'm using visual studio 2019 develop against ASP.Net application. Here's what been worked for us:
Open your Project Property Windows, Disable Anonymous Authentication and Enable Windows Authentication
In your Web.Config under system.web
<authentication mode="Windows"></authentication>p
And I didn't change application.config in iis express.

IIS Express - Visual Studio - Running multiple sites on the same port

I have multiple APIs that use the same port (8888). These APIs are part of different solutions.
http://localhost:8888/api1
http://localhost:8888/api2
....
When I run any of the APIs in visual studio 2013 (hit F5), iis express starts and all of the APIs are running. This happens even though the APIs are part of different solution. I can see them when I click on the iis express icon under View Sites.
I installed VS 2015 and when I run one API in visual studio the other APIs do not run. I cannot even run the other APIs in the other solution since I get:
unable to launch iis express.. port is in use
how can I get the other APIs to run when I run any API? I need to mimic the behavior that exists in VS 2013 in VS 2015.
Thanks.
I solved this for a similar scenario, although in my case I chose to run IISExpress via the command line and passed through the config file as an argument.
Edit the applicationhost.config file. I found mine via the folder path %USERPROFILE%\Documents\IISExpress\config
Locate the <sites> section (found under <system.applicationHost>)
As an example, I have two applications that I want to host simultaneously on port 80 on localhost:
<sites>
<site name="test" id="1" serverAutoStart="true">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\codepath" />
</application>
<application path="/api1" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\codepath\api1" />
</application>
<application path="/api2" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\codepath\api2" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":80:localhost" />
</bindings>
</site>
<!-- other settings relevant to your installation of IISExpress-->
</sites>
The key things I had to do to get this working was:
Make sure applicationhost.config is well-formed XML
Make sure you specify the root path in addition to the two api application paths
serverAutoStart="true" ensures the site starts when IISExpress is called
All the applications share the same applicationPool
I defined just one site and bundled in all my applications as sub paths
Update to this in Visual Studio 15+ the IIS config folder is in the projects hidden .vs folder [ProjectFolder]/.vs/[ProjectName]/config/applicationhost.config
Other than that, Ivor's Answer still worked for me.
If you do want the old behavior, use global application host file in your project file please,
<UseGlobalApplicationHostFile>True</UseGlobalApplicationHostFile>
http://blog.majcica.com/2018/03/15/using-global-application-host-file-in-visual-studio-2015/

Resources