Unable to resolve service for type 'Microsoft.AspNetCore.Hosting.IHostingEnvironment - asp.net-core

I'm in the middle of upgrading from netcore2.2 to netcore3.1
I have a line that calls to services.AddApplicationInsightsTelemetry(); which results in the below
System.InvalidOperationException: 'Unable to resolve service for type 'Microsoft.AspNetCore.Hosting.IHostingEnvironment' while attempting to activate 'Microsoft.AspNetCore.Hosting.DefaultApplicationInsightsServiceConfigureOptions'.'
I know this is related to an on-going issue (https://github.com/microsoft/ApplicationInsights-dotnet/issues/1869), but that doesn't help me resolve the issue.
Is there a known work-around?

I'd udpated everything, turns out it was a test mocking out IHostingEnvironment

Related

AggregateException: Some services are not able to be constructed.Unable to resolve service for type

when I scaffolded and run my project I got this error.would you please help me?
I changed my lifetime from scoped to transient but nothing changed

Getting error for Web Services Fail in CRM

Can anyone please help me about following error which we are getting under windows application log from CRM on prim.
The Web Service plug-in failed in OrganizationId: 7458se-161e-w311-1232-078547452d8; SdkMessageProcessingStepId: bvd23412-ea3e-bv212-86a7-74s7e5fkjyejnc; EntityName: serviceappointment; Stage: 30; MessageName: Update; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3852332364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
We do get this error randomly once a while, We don't know what causing it and how to resolve it?
Please help
This error is internal to the Microsoft Plugin hosting process. If you're using CRM online, open up a support ticket with MS. If your self hosting, turn on Tracing and see if you can see any additional information.
Obviously this is happening for the Update of a ServiceAppointment, but besides that, there isn't much more to go off of.

From where i can get AuthenticationFault Exception jar?

Hi I am authenticating alfresco using WebServiceFactory.setEndpointAddress but i am getting following error:
No exception of type AuthenticationFault can be thrown; an exception type must be a subclass of Throwable
Anyone can help me with this?
It's part of the org.alfresco.webservice.authentication package within the alfresco-web-service-client-3.2.jar.
As to why your authentication is failing, make sure you put the webserviceclient.properties file in the alfresco folder. Alfresco reads this property repository.location=http://localhost:8080/alfresco/api.
Check their SDK for more elaborated sample codes.

how to solve Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found?

I have created application, it showing this error message during initialization (Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.),how to fix it?
thank's in advance.....
Without more information I cannot provide a definitive answer - but it's more than likely the path for some resources needed for your Flex application are incorrect. Can you provide any more details? Double check all of your paths.

AddressFilter mismatch at the EndpointDispatcher

I have a WCF Web application that uses a WCF Class Library.
My project is a WCF Web project and I am self-hosting.
My problem is that all my web service methods hang with:
And "Unable to automatically step into the server...etc".
The error (not very helpful) returned is:
The operation has timed out
When I invoke the same method(s) using the WCF Test Client
I get the correct response and everything goes smoothly.
So, something must be wrong with my web application.
Following up on a similar post, I used the Service Trace Viewer.
I am getting the error:
The message with To
'http://localhost:8731/Design_Time_Addresses/Authentication/mex/mex'
cannot be processed at the receiver, due to an AddressFilter mismatch at the
EndpointDispatcher. Check that the sender and receiver's EndpointAddresses
agree.
After reading a related post, I tried adding:
[ServiceBehavior(AddressFilterMode=AddressFilterMode.Any)]
And recompiling my class library and updating my services to no avail... still hangs.
I have tried adding both my web service and my web project as startup projects but
I am still unable to step into the code. I also have all the appropriate DEBUG attributes
set in Web.config and App.config.
Any suggestions out there?
From my experience the mex/mex error occurs when I update a service reference in Visual Studio. I have come to the conclusion that this is just part of how Visual Studio figures out how to update the web service rere
Without knowing what your configuration looks like, it's hard to say what's wrong. However, why does your URL have /mex twice in it? Are you sure that's right?