IIS Express Crashing when Closing Developer Dialog in Brave Browser - asp.net

I am using Windows 10 Pro, and am running a .NET Core 3.1 application on top of IIS Express 10.0.1741 in Visual Studio 2019, version 16.7.6.
I have created a Razor page to upload a file with the exact code from this blog:
https://www.learnrazorpages.com/razor-pages/forms/file-upload
Setup for the issue: run the program (debug or release), navigate to the page using Brave browser (normal or private), and open the file upload dialog window.
Everything is fine at this point.
When the file dialog is closed, either by selecting a file or by hitting cancel, IIS Express crashes with exit code -1.
There is an error message in the Event Log:
Log Name: Application
Source: Microsoft Security Client
Date: 11/2/2020 11:20:08 AM
Event ID: 5000
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: ****
Description:
The description for Event ID 5000 from source Microsoft Security Client cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
0x1
ProtectionManagement
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft Security Client" />
<EventID Qualifiers="0">5000</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2020-11-02T17:20:08.484614300Z" />
<EventRecordID>39640</EventRecordID>
<Channel>Application</Channel>
<Computer>****</Computer>
<Security />
</System>
<EventData>
<Data>0x1</Data>
<Data>ProtectionManagement</Data>
</EventData>
</Event>
But I can not figure out how to resolve this issue. I can't find logs, or dump files for IIS Express.
I have not been able to reproduce this on another Windows Server computer on the same network, with presumably the same security settings (though it is a server OS).
I have tried to sniff the packets using Fiddler, and there isn't a new HTTP packet that comes across when this happens, so it must be at a lower level on the IP stack (connection level maybe?)
I am worried about not understanding this, and it biting me again in the future.
Any ideas about what this might be?

Related

Can't get simple Azure AD ASP.NET authenticated web app to work

I have used the Visual Studio template for an ASP.NET Webforms app with Azure AD authentication to create a simple web app. It works 100% fine locally. I can sign in, sign out, all good. Whenever I deploy to either AWS or Azure however, the behavior changes. The sign in still comes up fine, no issues at all, but after signing in, instead of taking me to the site, the browser just thinks for ages before dumping me to this error in the browser:
Server Error in '/' Application.
Runtime Error Description: An application error occurred on the
server. The current custom error settings for this application prevent
the details of the application error from being viewed remotely (for
security reasons). It could, however, be viewed by browsers running on
the local server machine.
Details: To enable the details of this specific error message to be
viewable on remote machines, please create a tag within
a "web.config" configuration file located in the root directory of the
current web application. This tag should then have its
"mode" attribute set to "Off".
I have tried adding the web.config setting and redeploying and it makes zero difference. Because I'm using App service on Azure for instance, I can't run the site on the actual web server as I don't have access to it. I tried looking at diagnostic log streaming, and got the below? Please help? Anyone? I have no idea why this isn't working. Interestingly, although I have asked that the site be http and it runs locally as http, once uploaded the url becomes https. Not sure if that' related.
From streaming logs (Azure)
HTTP Error 500.0 - Internal Server Error The page cannot
be displayed because an internal server error has occurred.
Most likely
causes: IIS received the request; however, an internal
error occurred during the processing of the request. The root cause of
this error depends on which module handles the request and what was
happening in the worker process when this error occurred.
IIS was not able to access the web.config file for the Web site
or application. This can occur if the NTFS permissions are set
incorrectly. IIS was not able to process configuration for
the Web site or application. The authenticated user does not
have permission to use this DLL. The request is mapped to a
managed handler but the .NET Extensibility Feature is not
installed. Things you can try:
Ensure that the NTFS permissions for the web.config file are
correct and allow access to the Web server's machine account.
Check the event logs to see if any additional information was
logged. Verify the permissions for the DLL.
Install the .NET Extensibility feature if the request is mapped
to a managed handler. Create a tracing rule to track failed
requests for this HTTP status code. For more information about
creating a tracing rule for failed requests, click here.
Detailed Error Information:
Module __DynamicModule_Microsoft.Owin.Host.SystemWeb.OwinHttpModule,
Microsoft.Owin.Host.SystemWeb, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35_79846f5c-7e22-4a97-8a1c-24bc400cf7db
Notification EndRequest
Handler ExtensionlessUrlHandler-Integrated-4.0
Error Code 0x00000000
Requested
URL https://SimpleADApp:80/
Physical
Path D:\home\site\wwwroot Logon Method Not yet
determined Logon User Not
yet determined
More Information: This error means that there was
a problem while processing the request. The request was received by
the Web server, but during processing a fatal error occurred, causing
the 500 error. View
more information » Microsoft Knowledge Base
Articles:

ASP.Net / AppFabric causes 4011 error "An unhandled access exception has occurred."

I am deploying a version of my website which I have developed AppFabric integration into, instead of using the ASP.NET Memory Cache (we're going to load balance a few web servers, so need distributed caching as opposed to local RAM caching).
Locally, I have AppFabric 1.1 installed, and my website communicates with it over 'localhost' (AppFabric installed on the same computer as the website runs out).
<dataCacheClient>
<hosts>
<host name="localhost" cachePort="22233" />
</hosts>
<securityProperties mode="None" protectionLevel="None" />
</dataCacheClient>
When I deploy this site to one of the test servers in our hosting environment (with AppFabric 1.1 also installed locally on that server), the site in IIS immediately fails, in under one second. If I stop IIS and then start it again, and then refresh the page locally, I get the IIS generic "HTTP Error 500.0 - Internal Server Error" in 800ms. This surprised me - I thought the site would be spinning up ASP.NET stuff and not actually running "user code" in that quick of a time.
So all the site's data access has changed to the pattern of, "check AppFabric for object, if it doesn't exist, retrieve from DB & store inside AppFabric" - so it seems
If I deploy a version of the site to the exact same folder, with all of the AppFabric caching changed to use the in-memory ASP.NET cache, then the site loads with no issues, so the problem is 100% related to AppFabric.
There is no exception logged, I simply see the generic "HTTP 500.0 Internal Server Error" message. If I check the Event Viewer then I can see an exception logged:
Event code: 4011
Event message: An unhandled access exception has occurred.
Event time: 01/12/2017 12:37:19
Event time (UTC): 01/12/2017 12:37:19
Event ID: 84321f68413340daaf0badf122ceed87
Event sequence: 4
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-3-131566054392620836
Trust level: Full
Application Virtual Path: /
Application Path: ..\..\..\..httpdocs-shared-cache\
Machine name: machine
Process information:
Process ID: 26752
Process name: w3wp.exe
Account name: -
Request information:
Request URL: https://localhost:443/Index.aspx
Request path: /Index.aspx
User host address: ::1
User:
Is authenticated: False
Authentication Type:
Thread account name: -
Custom event details:
There is no stacktrace to show WHERE the failure is occurring.
I have configured AppFabric's security like this (as a test) - and as shown in the web.config, we talk to AppFabric with 'None' for both security mode & protection level.
Set-CacheClusterSecurity -SecurityMode None -ProtectionLevel None
I have hit a brick wall with this and am not sure where else to turn. I tried to install AppFabric 1.0 on the server but it is no longer supported on Windows 2016.
Locally I am using AppFabric 1.1 and am running on Windows 10. As stated, if I deploy the exact same codebase, just with AppFabric communication replaces with .NET memory cache then the site loads okay on the server, which is why I'm convinced it's related to AppFabric.
Does anyone have any pointers as to where I can start to look into this further? I tried
Turns out, ELMAH was catching the exception and still creating the XML log file. This pointed me towards 'Access to the 'global' registry key is denied' - you have to add the application pool user to the 'performance log' and 'performance monitor' user groups.

health monitoring to eventlog setting source

I want to setup health monitoring in my asp.net app (using .net 4.5).
In production we will log the health events to a separate database (along with other operational type data).
In development though I'd like to setup to use the event log so there isnt a need to setup the other database when developing.
I have got logging to the event log working however I don't know how I can filter out the event log events only for the ones for my application.
Looking at them an event looks like this
Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 29/07/2012 8:50:46 PM
Event ID: 1305
Task Category: Web Event
Level: Information
Keywords: Classic
User: N/A
Computer: scorpion
Description:
Event code: 1004
Event message: Application compilation finished.
Event time: 29/07/2012 8:50:46 PM
Event time (UTC): 29/07/2012 10:50:46 AM
Event ID: 41f9c898cda14f7685f5c448f13f806a
Event sequence: 10
Event occurrence: 4
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/5/ROOT-1-129880325799889790
Trust level: Full
Application Virtual Path: /
Application Path: c:\users\pyro\documents\visual studio 2012\Projects\MvcApplication3\MvcApplication3\
Machine name: SCORPION
Process information:
Process ID: 556
Process name: iisexpress.exe
Account name: scorpion\pyro
Custom event details:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="16384">1305</EventID>
<Level>4</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2012-07-29T10:50:46.000000000Z" />
<EventRecordID>6775</EventRecordID>
<Channel>Application</Channel>
<Computer>scorpion</Computer>
<Security />
</System>
<EventData>
<Data>1004</Data>
<Data>Application compilation finished.</Data>
<Data>29/07/2012 8:50:46 PM</Data>
<Data>29/07/2012 10:50:46 AM</Data>
<Data>41f9c898cda14f7685f5c448f13f806a</Data>
<Data>10</Data>
<Data>4</Data>
<Data>0</Data>
<Data>/LM/W3SVC/5/ROOT-1-129880325799889790</Data>
<Data>Full</Data>
<Data>/</Data>
<Data>c:\users\pyro\documents\visual studio 2012\Projects\MvcApplication3\MvcApplication3\</Data>
<Data>SCORPION</Data>
<Data>
</Data>
<Data>556</Data>
<Data>iisexpress.exe</Data>
<Data>scorpion\pyro</Data>
</EventData>
</Event>
The only thing that might be useful is the application domain but it doesn't look like that there is a way to access that through an eventlogentry short of doing some kind of nasty parsing.
Is there something I'm missing here and I could actually set something in the log that would make it easier to filter out ones just for my app, I could look for the asp.net string but that doesn't guarantee its only going to get things directly related to my app.
If it isn't possible to do this without having to rewrite the provider, is there a better provider to use for a throw away kind of development scenario that doesn't require much setup.

Tridion UI - "Bad Request"

I have installed Tridion UI 2012 folowing to the documentation and everything seems fine and I can use the UI features such as create a new page, modify an existing page and so on but everynow and then (I haven´t been able to limit when or why) I receive a "Bad Request" error when clicking the "Update Preview".
The detailed error is displayed in the Event Viewer:
Log Name: Tridion
Source: Tridion Publishing
Date: 10/07/2012 12:03:37
Event ID: 100
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: ZZZZZ
Description:
Unable to update or add Binaries using OData Service.
An error occurred while processing this request.
BadRequest
Component: Tridion.SiteEdit.FastTrackPublishing
Errorcode: 1003
User: NT AUTHORITY\NETWORK SERVICE
StackTrace Information Details:
at System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d__1e.MoveNext()
at System.Data.Services.Client.DataServiceContext.SaveResult.HandleBatchResponse()
at System.Data.Services.Client.DataServiceContext.SaveResult.EndRequest()
at System.Data.Services.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.SaveBinaries(RenderedItem renderedItem, ContentDeliveryService service)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.SaveBinaries(RenderedItem renderedItem, ContentDeliveryService service)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.Preview(IEnumerable`1 publishedItemsInfo, TcmUri publishingTargetId)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.Preview(IEnumerable`1 publishedItemsInfo, TcmUri publishingTargetId)
at SyncInvokePreview(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Have you seen this error before? Any ideas how to avoid/repair it?
Regards
Emma
A little late to the party, but in my case this was caused by binaries that were too big.
You can pinpoint the issue in more detail by following the steps: (Tridion 2011, SP1, HR2, but I assume this is also valid for 2013)
On the CMS server, open the TcmServiceHost.exe.config and
uncomment the body of the following tag:
<system.diagnostics><sources>
Locate the <sharedListeners> tag and create the directory that is mentioned in the initializeData attribute (or update this setting)
Restart the TcmServiceHost service and click 'Update Preview'. The logfile shows up and you can open it in the SvcTraceViewer
Find the red entry and go from there.
To allow bigger binaries (consider the performance cost!) go to your OData Session Preview Service and do the following:
Open the web.config and locate the <bindings><webHttpBinding> (the relevant binding of course, but usually this is the webHttpBinding.)
Add a binding with the following properties (inside the <webHttpBinding> element):
<binding name="AdustedBindingConfiguration" maxReceivedMessageSize="2097152000"
maxBufferSize="2097152000">
<readerQuotas maxArrayLength="81920" maxBytesPerRead="5120" maxDepth="32" maxNameTableCharCount="81920" maxStringContentLength="2097152" />
</binding>
Locate the <services><service> tag and find the relevante service ('Tridion.ContentDelivery.Webservice.ODataService' and update the bindingConfiguration attribute to match the name of the newly added binding (AdjustedBindingConfiguration in this case)
Hit 'Update Preview' again
I haven't seen exactly this one, but something similar when my Session Preview Content Delivery Endpoint URL was misconfigured.
Reading the error description I would guess your endpoint URL (the Session Preview oData service) is up and running, but it might have some other issues. I would checkout if you can manually browse that oData service and if that looks okay perhaps check out its logfiles for more details.
On IIS this typically means an issue with the correct jars and DLLs, please check the following steps for that:
For the oData website, ensure DLLs are copied from the User Interface folder \Content Delivery\roles\webservice\dotNET\webapp\x86_64.zip\bin and jars are updated from \Content Delivery\roles\webservice\dotNET\webapp\x86_64.zip\bin
For the oData website, verify if web.config nodes "bindingConfiguration" attribute are correct
For Preview website, ensure DLLs are copied from the User Interface folder \Content Delivery\roles\web\dotNET\webapp\x86_64.zip\bin and all jars are replaced with contents from the User Interface folder \Content Delivery\roles\web\dotNET\webapp\x86_64.zip\bin\lib
For me, the solution was to increase maxReceivedMessageSize to "524288000" and maxBufferSize to "524288000" in the standard web.config of the Session Preview Webservice
<webHttpBinding>
<binding name="HttpBinding" maxReceivedMessageSize="524288000" maxBufferSize="524288000">
<readerQuotas maxArrayLength="81920" maxBytesPerRead="5120" maxDepth="32" maxNameTableCharCount="81920" maxStringContentLength="2097152" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="None" />
</security>
</binding>

Process Monitor shows "path not found" for valid URLs

We use "Process Monitor" (ProcMon) to monitor the w3wc.exe process on a Windows Server 2008 running IIS7 . We have noticed that requests to perfectly legal urls still results in a "PATH NOT FOUND" entry in ProcMon.
For example, we have configured a handler in web.config like:
<add name="ImageVaultHandler.aspx_*" path="ImageVaultHandler.aspx" verb="*" type="ImageStoreNET.Classes.Handlers.ImageHandler, ImageStoreNET" preCondition="integratedMode,runtimeVersionv2.0">
Requests to this handler eg. "http://localhost/id_123/ImageVaultHandler.aspx" will return an image as expected, but when you analyze the request in ProcMon the w3wc.exe process looks to have unsuccessfully searched for a physical file with the same path in my web directory.
Is this behaviour by design? Or have we missed something, the application pool used is configured to run in "Integrated Mode".
This sounds reasonable to me - what IIS is probably doing is checking to see whether or not the file exists in order to determine what handler to use when processing that request:
It looks like the logic in IIS doesn't bother to check first whether there is an applicable handler that can be used even when the file doesn't exist.

Resources