issue with application pool reference - IIS Express 7.5 - iis-express

I Have made the application pool entry, virtual directory entry in applicationhost.config file of IIS Express 7.5
Ex:
Application Pool Entry:
<add name="samples" enable32BitAppOnWin64="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
<processModel identityType="LocalSystem" />
</add>
Virtual Directory Entry
<application path="/samplebrowser.Web" applicationPool="samples">
<virtualDirectory path="/" physicalPath="C:\Users\vel\AppData\Local\Sample\SB.Web" />
</application>
i just click the IIS Express icon in the System tray to browse the sample which has the entry in applicationhost.config file, my sample has not listed there.
If i removed the {applicationPool="samples"} from virtual directory entry, we can see the sample in the system tray. Else i cant.
My requirement:
without removing the {applicationPool="samples"} from virtual directory entry, my sample will be listing out in the system tray.
can anyone please help on this?
please give high priority to this.
Thanks in advance.

IIs Express does not run with application pool identity, instead it runs as current user, so it would not respect processmodel settings.
Try to start iisexpress.exe from command line and check if there is any error during the startup.
To do that, go to IIS Express installation folder and run the following command.
iisexpress.exe /site:"your-site-name" /trace:d

Related

Cannot use "stop" to debug asp classic page on one web but can another

I have two web sites run in IIS on a Windows 2019 server. I've been able to debug both by typing "stop" in the VBscript and it pops up a dialog box that says a "script breakpoint" occurred and which debugger do I want to use. I select Visual Studio 2022 and away we go.
Until now... all of a sudden, I can't debug one of them (development) but I can the other (production). There is NO ERROR, it just doesn't pop up the debug dialog box. I've changed a few pages in dev (asp and aspx) but nothing that should affect any settings. Both are on the same server and the only two web sites in IIS. They "should" be mirror images of each other when development is moved to production.
Compared IIS, ASP, Debugging properties and they are the same.
Run iisreset and rebooted numerous times.
Made sure web.config's are the same.
Started VS and attached to the development w3wp.exe... just ignores the stop command.
Put stop in a second page of the root of each web, production stops, dev doesn't
Checked registry - Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
Debugger string is "C:\windows\system32\vsjitdebugger.exe" -p %ld -e %ld -j 0x%p
Coded a divide by zero in each page
production opens debug dialog and then gives HTTP Error 500.19 - Internal Server Error
dev shows white page with absolutely nothing in view source
I'm reasonably sure this is not a VS thing since both webs are built in the same VS... and actually the default page I'm putting the stop in was "hand" built, not in VS and the only pages in the root folder. So it seems like some setting in IIS, but what one?
Web.config is minimal for both:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
Any direction here would be greatly appreciated.

Configuring an installer to enable/disable startup on Windows start

I am trying to install an application for Windows 8.1 onwards so that it can be enabled and disabled to startup on Windows start both from the TaskManager and from Windows > Settings > Apps. The registry is being created like this:
<RegistryValue Id="myProgram.exe"
Root="HKLM"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
This successfully adds the program to the startup applications list, and it can be disabled / enabled from the Task Manager but cannot be controlled from Windows > Settings > Apps. The application shows up in the Windows Settings list, but you can tell toggling the enable / disable doesn't change anything by going into the registry and seeing that the value at HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My Program does not change. Why is Windows Settings not able to control this startup application?
Also, if we want to pre-enter a value for enabling / disabling startup at HLM\software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\My Program, which binary value would we use for each option?
According to this website https://winaero.com/blog/how-to-add-or-remove-startup-apps-in-windows-10/ the "Modern" startup apps system setting only applies to Run key in HKCU.
I've not tested this article. You might want to use profiling tools such as registry snapshot/diff and/or processexplorer to verify what this new settings screen is doing.
HKCU: I am not sure, and I can't test right now. Trying some hints. As Chris indicates: why do you write to HKLM? Change it to HKCU and see if that works:
<RegistryValue Id="myProgram.exe"
Root="HKCU"
Action="write"
Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Name="My Program"
Value="[INSTALLFOLDER]myProgram.exe"
Type="string"/>
Autoruns: There is a tool from SysInternals that is good to use when checking auto-run issues: https://learn.microsoft.com/en-us/sysinternals/downloads/autoruns. And a direct run from source link. Using this tool it seems that when disabling an item in the list, they are moved to a sub-key called AutorunsDisabled:

IIS8 Win8 and runAllManagedModulesForAllRequests="true"

I am attempting to run an application in IIS8 that has the following in the config:
<modules runAllManagedModulesForAllRequests="true" />
IIS8 is giving me an error that says...
This configuration section cannot be used at this path. This happens
when the section is locked at a parent level. Locking is either by
default (overrideModeDefault="Deny"), or set explicitly by a location
tag with overrideMode="Deny" or the legacy allowOverride="false".
I'm guessing by the error and a quick SO search that there is some higher level security setting that's preventing that line from being allowed. Any ideas?
I've solved the same problem by installing the window features "Internet Information Service/World Wide Web Service/Application Development/ASP.NET x.x" in the Control Panel of Windows8. If you want to setting on Windows Server 2012, the following link gives you hint.
http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45
hope that it works out.
For those of you running Windows Server 2012 the Application Development features are found at
[] Server Roles
[] Web Server IIS
[] Web Server
[] Application Development
[] ASP.NET x.x
When you select the .NET version it will ask if you want to add Extensions and other features. I just said yes, but you may be able to get away without installing those.
its hard to give a specific answer here, but the basics of it are that you need to look at the machine.config for the box you're running on. find the system.webServer node and look for the 3 tags/attributes its referencing in the error. chances are you'll find something that is marked as not overridable (allowOverride="false"), but i've not messed with windows 8/server 2012 yet, so i don't know what the machine.config looks like.
You can unlock the section via the IIS UI per https://serverfault.com/a/516921/137255
Open IIS Manager
Click the server name in the tree on the left
Right hand pane, Management section, double click Configuration Editor
At the top, choose the relevant section based on the offending item's XPath; i.e. system.webServer/modules for this example.
Right hand pane, click Unlock Section

Adding a web reference in Visual Studio 2010 to point to a Sharepoint 2007 site

I'm building a console application that can load a content type and remove the seal on it through C#. In attempting to add a web reference to the application, I'm getting an error which is strange because I use the same web reference in another application and it works fine. I'm pretty sure I hit this problem before and fixed it, but I cannot remember how :(
My steps:
Right-click project and click Add Service Reference...
Click Advanced... button
Click Add Web Reference... (I receive the same error when attempting to add this as a Service Reference instead)
Paste URL in text box: http://(domain)/videolibrary/_vti_bin/lists.asmx and press Enter
The box on the left side shows all my service operations, but the box to give the web reference a name and the Add Reference button are grayed-out and the following error is shown above:
There was an error downloading
'http://(domain)/videolibrary/_vti_bin/lists.asmx'.
Unable to connect to the remote server
No connection could be made because
the target machine actively refused it
127.0.0.1:80 Metadata contains a reference that cannot be resolved:
'http://(domain)/videolibrary/_vti_bin/lists.asmx'.
There was no endpoint listening at
http://(domain)/videolibrary/_vti_bin/lists.asmx
that could accept the message. This is
often caused by an incorrect address
or SOAP action. See InnerException, if
present, for more details. Unable to
connect to the remote server No
connection could be made because the
target machine actively refused it
127.0.0.1:80 If the service is defined in the current solution, try building
the solution and adding the service
reference again.
EDIT: Tried changing Target Framework from .NET Framework 4 Client Profile to .NET Framework 3.5 to no avail
The following solved my problem:
http://social.msdn.microsoft.com/Forums/zh/wcf/thread/02ce9fb9-6f67-45ec-9668-2dcd2317aab0
If you are behind firewall you need to make Visual Studio use the system proxy settings which can be done by manipulating your devenv.exe.config file.
Open it in Visual Studio and alter the section as below:
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy usesystemdefault="True" proxyaddress="http://yourproxyserver:port" bypassonlocal="False"/>
</defaultProxy>
<settings>
<servicePointManager expect100Continue="false" />
<ipv6 enabled="true"/>
</settings>
</system.net>
I tried it from a VM and it worked fine. Go figure. Must be something with my outgoing proxy settings.
i used target framework as 3.5 and i din't face any issue adding the webreference
i would suggest retry the steps you followed

HttpContext.Current.User.Identity.Name is Empty

I have a Silverlight application (using MVC) and when i'm building in visual studio, using Visual Studio Development center, there's no problem, the HttpContext.Current.User.Identity.Name has a Value
But when i'm using the same project with IIS 7.5 (i'm using Windows 7), HttpContext.Current.User.Identity.Name stays empty
Anyone who can help? Or knows where i can find the settings from the visual studio Development center, so i can check what's wrong in IIS?
I struggled with this problem the past few days.
I suggest reading Scott Guthrie's blog post Recipe: Enabling Windows Authentication within an Intranet ASP.NET Web application
For me the problem was that although I had Windows Authentication enabled in IIS and I had <authentication mode="Windows" /> in the <system.web> section of web.config, I was not preventing anonymous access. This last part was the key. You need to prevent anonymous access to ensure that the browser sends the credentials.
You can either configure IIS in Control Panel so that your site (or machine) uses Windows authentication and denies anonymous access or you can add the following to your web.config in the system.web section:
<authentication mode="Windows" />
<authorization>
<deny users="?"/>
</authorization>
These might resolve the issue(It did for me). In IIS Express change the project property values, "Anonymous Authentication" and "Windows Authentication". To do this, when project is selected, press F4 and then change these properties.
In case you are deploying it on IIS locally, make sure local machines "Windows Authentication" feature is enabled and "Anonymous Authentication" is disabled.
Refer to
https://grekai.wordpress.com/2011/03/31/httpcontext-current-user-identity-name-is-empty/
In addition to "answered Mar 28 '11 at 12:27Bryan Bedard"
In case that the solution doesn't work, you have to enable Windows Authentication in iss manager.
How to do that:
1.To start IIS Manager from the Run dialog box:
On the Start menu, click All Programs, click Accessories, and then click Run.
In the Open box, type inetmgr and then click OK.
2.In the Connections pane, expand the server name, expand Sites, and go to the level in the hierarchy pane that you want to configure, and then click the Web site or Web application.
3. Scroll to the IIS section in the Home pane, and then double-click Authentication.
4.In the Authentication pane, select Anonymous Authentication, and then click Disable.
In the Authentication pane, select Windows Authentication, and then click Enable.
Reference
Disabling all other options in authentication tab of iis except windows authentication resolved my issue.
Please check..
Steps:
Open iis in your machine
Select your application from the application pool
Click on authentication option
Disable all other option except windows authentication (Anonimous authentication should be disabled)
Please check this and let me know the feedback. It worked for me. hope it will work for you also..
I also had this problem recently. Working with a new client, trying to get a an old web forms app running from Visual Studio, with IISExpress using Windows Authentication.
For me, the web.config was correctly configured
However, the IISExpress.config settings file had:
<windowsAuthentication enabled="false">
The user account the developer was logged in was very new, so unlikely it had been edited.
Simple fix it turned out, change this to enabled=true and it all ran as it should then.
Also, especially if you are a developer, make sure that you are in fact connecting to the IIS server and not to the IIS Express that comes with Visual Studio. If you are debugging a project, it's just as easy if not easier sometimes to think you are connected to IIS when you in fact aren't.
Even if you've enabled Windows Authentication and disabled Anonymous Authentication on IIS, this won't make any difference to your Visual Studio simulation.
The browser will only detect your username if the IIS server is on the same domain and the security settings within your group policy allow it.
Otherwise you will have to provide it with credentials, but if it is not on the same domain, it will not be able to authenticate you.
Apart from all obvious reasons mentioned earlier, there might be another one: you didn't put an Authorize attribute on top of your controller, like that:
[Authorize(Roles = "myRole")]
[EnableCors(origins: "http://localhost:8080", headers: "*", methods: "*", SupportsCredentials = true)]
public class MyController : ApiController
At least that's what worked for me.
As #PaulTheCyclist says, If using IISExpress anonymous authentication is enabled by default, windows authentication is disabled.
This can be changed in what I'm sure used to be called PropertyPages (NOT right-click -> properties). Select the web project
Try enabling basic authentication and disabling the other authentications in IIS, then try launching the application. The application will ask for windows credentials. Enter the same and the app should be able to get the name under HttpContext.Current.User.Identity.Name.
I was facing this issue when authentication mode was not set while creating the project.
So It worked when created a new project with authentication set to windows mode in the initial settings.

Resources