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

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

Related

Unable to resolve service for type 'Microsoft.AspNetCore.Hosting.IHostingEnvironment

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

Unable to add Java service reference to WCF client

I am uanble to add the below Java service reference in WCF Client
https://filetransfer.nordea.com/services/CorporateFileService
getting below error .
There was an error downloading 'https://filetransfer.nordea.com/services/CorporateFileService/$metadata'. The request failed with the error:
I opened the port 8000. still getting same issue.
Please let me know what is the issue.
Thanks
Jaya
Please note that a WCF service normally expose a file called a WSDL(Web Services Description Language) - this file explains the methods that you will use with the service
https://www.w3.org/TR/2001/NOTE-wsdl-20010315
Normally an endpoint needs to be created and be accessible for ypu to be able to view the service, what I would suggest is that if WCF doesnt seem to be doing that for you, try adding the service as a webservice Reference in your C#/Java project.
https://www.blackbaud.com/files/support/guides/infinitydevguide/Subsystems/infGC-developer-help/Content/AddingWebReference.htm

local work but hosting on AppHarbor can not query SQL Server

So I have my web.config connection string pointing to my SQL Server on appharbor - from local (running Visual Studios) I can login and the memberships works. However from the build that is on the hosting side I get sorry, an error occurred while processing your request.
This is strange because I made a new user from local and check with SQL Server Management Studio whether or not the data has been added to the hosting server and it WORKS.
From my latest build I get the error:
Sorry, an error occurred while processing your request.
which is weird because they both point to the same server...
Anyone have an idea of what I am doing incorrectly?
ASP.NET MVC project has the "HandleErrorAttribute" on by default. You should remove it from FilterConfig.cs in App_Start Folder to see the actual error rather than the handled response.
It's located in the RegisterGlobalFilters method where filters.Add(new HandleErrorAttribute()); should be removed.
AppHarbor has a FAQ to help you troubleshoot deployment errors like these. In particular, you should inspect the "Errors" interface on AppHarbor and disable customErrors. Please elaborate the question if the FAQ doesn't help you solve the problem.

Magento Soap Interface, Invalid WSDL

I am having a problem where the soap interface to Magento (http://172.16.0.119/index.php/api/v2_soap?wsdl) is generating invalid wsdl. When I try to generate a proxy using visual studio I get an error that there are several elements declared more than once in the document for example
Source: Line: 44 Column: 4 Validation Error: The global element
'http://schemas.xmlsoap.org/soap/encoding/:Array' has already been
declared
I thought that perhaps I had something corrupted in my magento install as I have several plugins and such running, so I done a fresh install of magneto 1.6.1 with no plugins or anything. I still receive this error. Has anybody else had this problem? How did you resolve it?
Thanks in advance.
There is a setting within the admin module that allows you to set the WS-I (http://en.wikipedia.org/wiki/Web_Services_Interoperability) Compliance flag to True. I was receiving a number of issues with VS2010 and the Magento API until I changed this flag.
It can be found in System -> Configuration -> Services -> Magento Core API
Hope this helps.

WCF service deployed to Azure

I have create a WCF Service Web Role project.I can consume the service locally. But I am having issues trying to deploy the service on the azure cloud. After starting the webrole it justs kepps going in a loop where it init then stops. I have not made any changes to the default WebRoleclass that was added automatically. Can anybody point me to some samples or examples of WCF being deployed to azure
The behaviour you're seeing occurs when the instance errors in the OnStart or Run. The usual diagnostics error trapping hasn't had a chance to start yet so this is a difficult problem to debug. You might try adding error trapping inside this functions that writes the error details out to either a blob or a queue so that you can see what is actually happening.
Having said that, with code that works in the dev fabric, but continues to cycle when deployed to live, the first thing to check is that all of the references have the appropriate "Copy Local" property set. Anything that is part of the framework or Microsoft.WindowsAzure.ServiceRuntime will need to have Copy Local to false, everything else should be set to true (third party assemblies an the like). If this is a web role and you're using MVC, you'll need to check that System.Web.Mvc has Copy Local set to true as well as this is not included as part of the standard framework deployed in Azure.
Have you looked at the Known Issues information on the WCF Azure code page? There's a patch that's needed, as well as a tweak to the service behavior. Hopefully this will help you.
I just found out the root of the problem. It was caused by one of my projects having the target platform set to x86. Seems like it does not support x86 build assemblies which can be a problem