ASP.NET HttpHandler error after Windows 10 Fall Creators Update - c#

A couple of days ago my Windows 10 development machine got the Falls Creators Update.
Since then every attempt to register a custom HttpHandler in any ASP.NET Web Site (not web application) fails with error:
Failed to map the path '/App_GlobalResources/'.
The stack trace is:
[InvalidOperationException: Failed to map the path '/App_GlobalResources/'.]
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath,
Boolean permitNull) +8965114
System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42
System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate2
(StandardDiskBuildResultCache diskCache) +295
System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate
(StandardDiskBuildResultCache diskCache) +55
System.Web.Compilation.BuildManager.RegularAppRuntimeModeInitialize() +174
System.Web.Compilation.BuildManager.Initialize() +238
System.Web.Compilation.BuildManager.InitializeBuildManager() +267
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +224
[HttpException (0x80004005): Failed to map the path '/App_GlobalResources/'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9002835
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333
I am using Visual Studio 2015 with the integrated IIS express. I have some old asp.net web sites (.net version 2.0) that used to work. Now, even the following example does not work:
App_Code/MyHandler.cs:
public class MyHandler : IHttpHandler
{
public MyHandler()
{
//
// TODO: Add constructor logic here
//
}
public bool IsReusable
{
get
{
return false;
}
}
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/html";
context.Response.Write("Hello");
}
}
web.config:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<handlers>
<add name="MyHandler" verb="*" path="*.htm" type="MyHandler"/>
</handlers>
</system.webServer>
</configuration>
I really cannot understand what is happening and I've run out of ideas and patience. Please, help. TIA.

I've decided to follow #Hamlet Hakobyan's suggestion and uninstall Windows 10 Fall Creators Update.
Let me tell you right away that the problem is now fixed.
Here is my development setup in case someone faces the same situation:
Windows 10 build 1709 (Fall Creators Update)
Visual Studio Community 2015 Update 3
ASP.NET Web Site project (not web application project)
.NET framework version 2.0
IHttpHandler implementation in .cs file in App_Code folder.
Http handler registration in web.config for IIS Express running in Integrated Mode as per: https://msdn.microsoft.com/en-us/library/46c5ddfy.aspx
If your http handler(s) stopped working after having installed the Windows 10 Fall Creators Update and you receive the not-so-useful error below:
Failed to map the path '/App_GlobalResources/'.
then go ahead and revert to previous Windows 10 build (1703).
Hope it helps.

Related

Firestore functionality on a Windows iot core: error loading native library grpc_csharp_ext.x86.dll

Relatively new to the windows ecosystem. After following the windows documentation on setting up a background application on iot and google's quickstart for C#, I am receiving this error that I cannot seem to solve:
System.IO.IOException: 'Error loading native library "C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\BackgroundAppFirestoreOne-uwpVS.Debug_ARM.usernoname\grpc_csharp_ext.x86.dll". '
Stack Trace:
System.IO.IOException
HResult=0x80131620
Message=Error loading native library "C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\BackgroundAppFirestoreOne-uwpVS.Debug_ARM.usernoname\grpc_csharp_ext.x86.dll".
Source=Grpc.Core
StackTrace:
at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
at Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary()
at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
at Grpc.Core.Internal.NativeExtension..ctor()
at Grpc.Core.Internal.NativeExtension.Get()
at Grpc.Core.GrpcEnvironment.GrpcNativeInit()
at Grpc.Core.GrpcEnvironment..ctor()
at Grpc.Core.GrpcEnvironment.AddRef()
at Grpc.Core.Channel..ctor(String target, ChannelCredentials credentials, IEnumerable`1 options)
at Grpc.Core.Channel..ctor(String host, Int32 port, ChannelCredentials credentials, IEnumerable`1 options)
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(ServiceEndpoint endpoint, IEnumerable`1 channelOptions, ChannelCredentials credentials)
at Google.Api.Gax.Grpc.ChannelPool.GetChannel(ServiceEndpoint endpoint, IEnumerable`1 channelOptions)
at Google.Cloud.Firestore.FirestoreDb.Create(String projectId, FirestoreClient client)
at BackgroundAppFirestoreOne.StartupTask.<Run>d__4.MoveNext() in C:\Users\usernoname\source\repos\BackgroundAppFirestoreOne\StartupTask.cs:line 95
The file is in the directory and does have the necessary permissions.
My environment:
Developing on Windows 10 with Visual Studios 2019 Enterprise
Deploying to a Dragonboard 410c with Windows 10 iot Core
Google.Cloud.Firestore NuGet referenced
I've tried:
Adding the gRPC.core as this suggested, as a NuGet package reference in VS2019, this did not solve the issue.
And I don't have any non-English characters as this suggests.
This error occurs when attempting to execute FirestoreDb db = FirestoreDb.Create(project);
(see line 44 of sample)
Does anyone know what this could be / what I could try to rectify?
I did not encount the exception with Google.Cloud.Firestore 1.1.0 on Windows IoT Core 17763. Could you please check the package version and OS version. BTW, it is not recommended to use the package in background app, since at the moment you can't register a headless app that uses filetypeAssociation, so that the app can not access the credential file(.json).

System.Reflection.AmbiguousMatchException on MongoDb.Driver

all.
I created Rest API with ASP.NET 4 and Mongo. It works fine in my local PC under Windows 10, also it works fine in test environment under Windows 2008 R2 + .NET 4.7.1. But it doesn't work on my prod environment under Windows 2012 R2 + .NET 4.7.1, I got the following error:
System.Reflection.AmbiguousMatchException: Multiple custom attributes of the same type found.
at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
at System.Runtime.InteropServices.RuntimeInformation.get_FrameworkDescription()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at MongoDB.Driver.Core.Connections.ClientDocumentHelper.CreateClientDocument(String applicationName)
at MongoDB.Driver.Core.Connections.BinaryConnectionFactory..ctor(ConnectionSettings settings, IStreamFactory streamFactory, IEventSubscriber eventSubscriber)
at MongoDB.Driver.Core.Configuration.ClusterBuilder.BuildCluster()
at MongoDB.Driver.ClusterRegistry.CreateCluster(ClusterKey clusterKey)
at MongoDB.Driver.ClusterRegistry.GetOrCreateCluster(ClusterKey clusterKey)
at MongoDB.Driver.MongoClient..ctor(MongoClientSettings settings)
at Treolan.Catalog.Providers.BaseDataProvider..ctor(IAppSettings appSettings) in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.Providers\BaseDataProvider.cs:line 39
at Treolan.Catalog.Providers.Categories.CategoriesProvider..ctor(IAppSettings appSettings) in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.Providers\Categories\CategoriesProvider.cs:line 22
at Treolan.Catalog.WebApi.Controllers.CategoriesController.<>c.<.ctor>b__6_0() in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.WebApi2\Controllers\CategoriesController.cs:line 31
at Treolan.Catalog.WebApi.Controllers.CategoriesController.<Get>d__7.MoveNext() in D:\Projects\TreolanCatalog\Treolan\Treolan.Catalog.WebApi2\Controllers\CategoriesController.cs:line 48
I found the similar issue, but other developers used Application Insight on Azure. I don't use Application Insight or Azure.
I tried to use MongoDb.Driver 2.5.0 and 2.6.1 but I got the same issue.
Could you help me?
I had this issue and after searching I have found a solution for me
My app is in an Azure VM
To solve this
Go to this machine using Terminal Server,
go to Control Panel,
go to programs/features
remove the application insights status monitor toolkit from server
This have resolved the issue for me
Hope it helps

UnauthorizedAccessException - The image location is not under specified directory

I am copying a web site, written in asp .NET, from a windows server 2003 machine to a windows server 2012 with IIS 8.5.
The web site is working great on the old machine, but no charts are displayed in any of my webpages on the new machine.
I get a strange error:
General Information
--------------------------------
MachineName: AYEVENS12MAVTST
TimeStamp: 10/08/2014 11:38:18
WindowsIdentity: NT AUTHORITY\SYSTEM
Exception Information
---------------------------------------
Exception Type: System.UnauthorizedAccessException
Message: The image location is not under specified directory.
Data: System.Collections.ListDictionaryInternal
TargetSite: Void ValidateUri(System.String)
HelpLink: NULL
Source: System.Web.DataVisualization
HResult: -2147024891
StackTrace Information
---------------------------------------
at System.Web.UI.DataVisualization.Charting.ChartHttpHandlerSettings.ValidateUri(String key)
at System.Web.UI.DataVisualization.Charting.DefaultImageHandler.System.Web.UI.DataVisualization.Charting.IChartStorageHandler.Load(String key)
at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.ProcessSavedChartImage(HttpContext context)
at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
This is weird since I see the path of the picture is correct and I can open the picture with no problem.
I thought it's a permission problem but I gave full control of the containing folder to IIS_USRS and to WindowsIdentity: NT AUTHORITY\SYSTEM and the same error keeps popping up.
What troubles me is the message "The image location is not under specified directory." since the image is where it's supposed to be.
Any help would be appreciated.
Have you tried to impersonate a specific authorized windows account using the web.config file ?
<configuration>
<system.web>
<identity impersonate="true" userName="user name" password=" user password" />
</system.web>
</configuration>
Well I solved it by (accidently) removing the line
<add key="ChartImageHandler" value="storage=file;privateImages=false;timeout=600;dir=c://TempImageFiles;deleteAfterServicing=false;" />
from the webconfig, I have no idea why this works.

Upgrading to NServiceBus 3.2.2 exception when starting endpoint

I recently upgraded my publisher/subscriber solution to NServiceBus version 3.2.2 using Nuget. My NServiceBus publisher and subscriber are both self-hosted.
Publisher code:
I start the NServiceBus publisher using NServiceBus.Host.exe (debug start action - start external program in project property).
app.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="MsmqTransportConfig" type="NServiceBus.Config.MsmqTransportConfig, NServiceBus.Core" />
<section name="UnicastBusConfig" type="NServiceBus.Config.UnicastBusConfig, NServiceBus.Core" />
<section name="MessageForwardingInCaseOfFaultConfig" type="NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core" />
</configSections>
<MsmqTransportConfig ErrorQueue="error" NumberOfWorkerThreads="1" MaxRetries="5" />
<UnicastBusConfig ForwardReceivedMessagesTo="">
<MessageEndpointMappings></MessageEndpointMappings>
</UnicastBusConfig>
<MessageForwardingInCaseOfFaultConfig ErrorQueue="error" />
</configuration>
EndpointConfig.cs:
namespace TrackEventPublisher.EventPublisher
{
[EndpointName("EventPublisher")]
public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher
{
}
}
I ran into the following error when running the publisher:
Exception when starting endpoint, error has been logged. Reason: An exception was thrown while invoking the constructor 'Void .ctor(Raven.Client.IDocumentStore)' on type 'RavenTimeoutPersistence'.
StackTrace:
at NServiceBus.Hosting.GenericHost.Start() in d:\BuildAgent-03\work\nsb.master22\src\hosting\NServiceBus.Hosting\GenericHost.cs:line 45
at NServiceBus.Hosting.Windows.WindowsHost.Start() in d:\BuildAgent-03\work\nsb.master22\src\hosting\NServiceBus.Hosting.Windows\WindowsHost.cs:line 56
at NServiceBus.Hosting.Windows.Program.<>c_DisplayClass8.b_4(WindowsHost service) in d:\BuildAgent-03\work\nsb.master22\src\hosting\NServiceBus.Hosting.Windows\Program.cs:line 95
at Topshelf.Internal.ControllerDelegates1.StartActionObject(Object obj) in d:\dev\open-source\topshelf\src\Topshelf\Internal\ControllerDelegates.cs:line 18
at Topshelf.Internal.IsolatedServiceControllerWrapper1.<>c_DisplayClass2.b_1(TService service) in d:\dev\open-source\topshelf\src\Topshelf\Internal\IsolatedServiceControllerWrapper.cs:line 65
at Topshelf.Internal.ServiceController1.<.cctor>b__1(ServiceController1 sc) in d:\dev\open-source\topshelf\src\Topshelf\Internal\ServiceController.cs:line 35
at Magnum.StateMachine.LambdaAction1.Execute(T instance, Event event, Object parameter) in :line 0
at Magnum.StateMachine.EventActionList1.Execute(T stateMachine, Event event, Object parameter) in :line 0
What might cause this error?
Can anyone tell me what is wrong with my endpoint configuration?
My solution worked great with an earlier version of NServiceBus (pre version 3.0).
Update:
Here is the inner exception message: "Unable to connect to the remote server"
Is the Raven server started automatically by NServiceBus? It would appear that it is not running on my machine...
Update
Well, for some reason the RavenDB service was not running on my machine - although it is set to start automatically. My solution is working correctly now. I guess I had to learn about the RavenDB the hard way :).
Has anyone out there had problems running the RavenDB service?
Update
Now that I have my service up and running, I try and run it on a different machine. The msmq folders are not created, and I get an error that the RavenDB is not available. In fact, RavenDB service is not installed after I ran my solution on a different windows OS machine. I tried running the "RunMeFirst.bat" that posted with version 3.2.2. However, the bat file attempts to install an extension with visual studio. Another error is posted if visual studio is installed, but Nuget extension is not installed.
Is there a better way to enable NServiceBus.Host.exe to install the RavenDB server and msmq folders without an instance of visual studio installed on the Windows OS machine?
Update
Wow, most updates ever! I added the following class to my publisher project which successfully created the msmq folders:
class MsmqTransportConfigOverride : IWantCustomInitialization, INeedToInstallInfrastructure<Windows>
{
public void Init()
{
Configure.Instance.ForInstallationOn<NServiceBus.Installation.Environments.Windows>().Install();
}
public void Install(System.Security.Principal.WindowsIdentity identity)
{
}
}
This new class which implements the IWantCustomIntialization interface seems to work great. However, I am still struggling to update my publisher to install the RavenDB on the windows host machine. I know there is a commandline prompt out there that can facilitate this, but is there another way? I tried to implement INeedToInstallInfrastructure interface, but I cannot find any examples out there. Does anyone have any ideas?
We only run the installers if you:
1. Install the endpoint as a windows service (if running in the production profile => the default)
2. Run in debug mode
3. Run in the integration/lite profiles
So that would explain why the queues are not created (assuming none of the above is true for you?)

How to solve a "HTTP Error 404.3 - Not Found" error?

Simple problem. I start up VS2008 and create a new WCF Service application. This will create a default application with a few test methods showing it works. I press CTRL+F5 and it does indeed work! Great! However, it uses the Visual Studio Development server, which I don't want to support.
So I go to the project properties, switch to using a local IIS Web server, create the virtual directory and press CTRL+F5 again. And this "HTTP Error 404.3 - Not Found" error is greeting me back.
So something in my IIS7/Vista-64 setup is wrong. What could I be missing?
Click Start -> Run cmd and type:
cd "\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation"
ServiceModelReg.exe -i
If you faced this problem for the first time. with Windows 8 and IIS 8.0 make sure to activate Windows Communication Foundation HTTP windows feature.
Go to Control Panel select "Programs and features"
From the lift hand side menu select "Turn Windows features on or off".
Expand ".Net Framework 3.5 (includes .NET 2.0 and 3.0)" item
Finally select "Windows Communication Foundation HTTP Activation"
Enjoy your WCF Servcie.
The problem, however, is then to re-register ASP.Net to IIS, which is explained below.
And also if you're on a 64bit machine always use Framework64 paths: C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -iru
Below is the explanation from Microsoft:
http://download.microsoft.com/download/0/A/E/0AEB3BC1-506E-4954-8AB1-4FA2EE75985C/ReleaseNotes.docx
When attempting to run a service that receives messages over the HTTP transport, you may receive an error similar to the following:
Server Error in '/WCFApplication' Application
Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Description: An unhandled exception occurred during the execution of the current Web request. Review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.TypeLoadException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
This error can occur when IIS is installed after installing .NET Framework 4, or if the 3.0 version of the WCF Http Activation module is installed after installing IIS and .NET Framework 4.
To resolve this problem, you must use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe,) to register the correct version of ASP.NET. This can be accomplished by using the –iru parameters when running aspnet_regiis.exe as follows:
aspnet_regiis.exe -iru
And credit, where it's due: Source
I had to tick "HTTP Activation" in "Add Role Services" within Windows Server 2012.
try to install IIS by expanding your Internet information service and then check ASP.Net 3.5 or ASP.Net 4.5 and ISAPI.... in root of world wide.........
please look image to more help
I tried running ServiceModelReg and aspnet_regiis.exe with various flags and added HTTP Activation feature but it still didn't work. What finally worked was adding the following handler manually to my web.config file.
<system.webServer>
<handlers>
<add name="svc-Integrated" path="*.svc" verb="GET,HEAD,POST,DEBUG" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" modules="ManagedPipelineHandler" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="integratedMode" responseBufferLimit="4194304" />
My project was running .Net 3.5 and IIS was 7.5 and 7.0.

Categories

Resources