failed due to the following error: 80070005 - asp.net

Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 23: public partial class Report_Agent_Commission : System.Web.UI.Page
Line 24: {
Line 25: ReportDocument obj = new ReportDocument();
Line 26: CrystalClass CCobj = new CrystalClass();
Line 27: static string repFile = string.Empty;
Source File:
d:\inetpub\vhosts\impactwebclients.com\httpdocs\Report_Agent_Commission.aspx.cs
Line: 25
Stack Trace:
[UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {5FF57840-5172-4482-9CA3-541C7878AE0F} failed due to the following error: 80070005.] CrystalDecisions.CrystalReports.Engine.ReportDocument..cctor() +207 [TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception.] CrystalDecisions.CrystalReports.Engine.ReportDocument..ctor() +0 PBS.GUI.Report_Agent_Commission..ctor() in d:\inetpub\vhosts\impactwebclients.com\httpdocs\Report_Agent_Commission.aspx.cs:25 ASP.report_agent_commission_aspx..ctor() in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\9b53e041\44708862\App_Web_report_agent_commission.aspx
This problem I am getting when using crystal reports 2008 version 10.5.3700.0, if I comment/delete the crystal report content on that particular webpage it is working fine. When I place a crystal reportviewer in the current web page it is showing error
Can you please help me out from here

i found a answer my self.. please place custom error mode on in webconfig
and check the error status number, 99% it gives error no :500 -- that is a internal server
error, on the server machine there is problem
problem may be they has to instal crystal reports runtime or else may be any other problem
so it is not on your coding part so raise a complaint to them after confirming 500 error
thanks all if it is usefull to anybody.. it would be great

Related

Adding WebAPI as a child/nested application in IIS

Steps to recreate this issue:
Inside IIS create a new .net 4 website (herein known as the parent).
Drop a test image in the folder for this website and observe you can
request it successfully in a browser
Add a new virtual directory OR application under the parent that points to a WebAPI 2 project
Attempt to access the API in the browser using www.path-to-parent-site.com/api/something/or/other
I get the following error:
System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Configuration.ConfigurationErrorsException: System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ConfigurationErrorsException: System.Web.Routing.UrlRoutingModule does not implement IHttpHandlerFactory or IHttpHandler.]
System.Web.Configuration.HandlerFactoryCache.GetHandlerType(String type) +12328272
System.Web.Configuration.HandlerFactoryCache..ctor(String type) +27
System.Web.HttpApplication.GetFactory(String type) +94
System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +375
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34209
Is there anything I can do to get this working? I can find very little relevant information on this particular issue and even fewer solutions to those who have seen this error.
Note: If I add the WebAPI 2 project as a new website in IIS it works perfectly; its only when its nested as a child (either virtual directory or application has the same problem) that this happens.
Thanks
WebApi is not supposed to be hosted on a virtual directory, if you wanna do so you need to make the routing pattern dynamic and load the first part from the virtual directory.
var virtualDirectory = request.ApplicationPath;
routes.MapHttpRoute(
name: "API Default",
routeTemplate: virtualDirectory + "/api/{controller}/{id}",
defaults: new {
id = RouteParameter.Optional
}
);
You need to use parentsite.com/childvirtualdirectory/api even though the API is hosted in the childvirtualdirectory.
In my scenario, I had parentsite/api setup in IIS... then to access the web API, I needed to use http://parentsite/api/api/<<controller>>

Error while running the published website on IIS 7.5

I have an asp.net website which is developed in asp.net 4.0 with data binding from a database which is maintain in sql server 2000..
It it working fine on localhost but when I am deploying it on IIS and while running the page following error is occurring.
Login failed for user 'testuser'. Reason: Not associated with a trusted SQL Server connection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: Login failed for user 'testuser'. Reason: Not associated with a trusted SQL Server connection.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
I am using mixed mode authentication and sql server 2008 is installed
on my system
I am using the following connection string in my .cs
page
using (OleDbConnection con3 = new OleDbConnection("Provider=SQLOLEDB;Data Source=sbs;User ID=testuser;Passwrd=pinkCITY01;Initial Catalog=PCGnet"))
try adding Integrated Security=SSPI to connection string
or refer below link
Login Failed 'sa'

exception Collection is read-only error with ASP4.5 on IIS7.5

I am running Dotnetnuke7 on a shared hosting environment using ASP.net 4.5 and IIS configured in integrated pipeline mode (as required by DNN7).
When I install it on a Win2008/IIS7 server (ASP4.0) at the hosting provider the application runs fine, but when I install it on a Win2008R2/IIS7.5 server at the hosting provider(ASP4.5) I get an exception Collection is read-only when trying to log-in or submitting anything to the site. (For example use DNN search function). See detailed stacktrace below.
The hosting provider checked the .net 4.5 permissions, and also applies apppool-specific permissions, but no luck yet.
Anybody a clue what IIS7.5 parameter or option can be the cause here?
Server Error in '/' Application.
Collection is read-only.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Collection is read-only.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NotSupportedException: Collection is read-only.] System.Collections.Specialized.NameObjectCollectionBase.BaseSet(String name, Object value) +6703734
System.Web.HttpServerVarsCollection.SetServerVariableManagedOnly(String name, String value) +116
System.Web.HttpServerVarsCollection.SynchronizeServerVariable(String name, String value) +28
System.Web.HttpRequest.SynchronizeServerVariable(String name, String value) +112 System.Web.Hosting.IIS7WorkerRequest.GetServerVarChanges(HttpContext ctx) +308 System.Web.Hosting.IIS7WorkerRequest.SynchronizeVariables(HttpContext context) +9676858 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +151
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
For anyone stumpling on this - I had this exact issue today.
Resolved by two actions for me:
Verify isapi filters in IIS for .net 4.0/4.5 etc are ALLOWED
I had installed rewriter-modules (Helicon). Once I removed these ISAPI-filters again - all worked fine.
So check isapi-filters is my advice and start without any additional filters except the needed .net filters.

Security issue accessing microsoft interop dll sending email

We have a simple piece of code here that recently stopped working and I have tried many 'things' to try and resolve the error.
The code
Application outLook = new Application(); :)
The error
Retrieving the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following
error: 80070005. Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack
trace for more information about the error and where it originated in
the code.
Exception Details: System.UnauthorizedAccessException: Retrieving the
COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed due to the following
error: 80070005.
ASP.NET is not authorized to access the requested resource. Consider
granting access rights to the resource to the ASP.NET request
identity. ASP.NET has a base process identity (typically
{MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if
the application is not impersonating. If the application is
impersonating via , the identity will be
the anonymous user (typically IUSR_MACHINENAME) or the authenticated
request user.
To grant ASP.NET access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add
the appropriate user or group. Highlight the ASP.NET account, and
check the boxes for the desired access.
Now whilst the error is quite obvious I cannot resolve it.
The application is a .net 2.0 web application and the server is windows 2008 r2 standard using IIS 7.0
Thanks
Using Client appliactions on a server is always going to be problematic - there are other ways to access mailboxes.
That said, this might help:
http://technoblogy.net/retrieving-the-com-class-factory-for-component-with-clsid-00024500-0000-0000-c000-000000000046-failed-due-to-the-following-error-80040154/

Please help me to upload image file to my site in asp.net-vb error

i want upload file to my site but give a error message
Access to the path 'C:\hshome\jahanmap\jahanmap.com\default\tatlises-rop.jpg' is denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.UnauthorizedAccessException:
Access to the path
'C:\hshome\jahanmap\jahanmap.com\default\tatlises-rop.jpg'
is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
Source Error:
Line 67: ' save the image
Line 68: saveFile = Path.Combine(savePath, FileUpload1.FileName)
Line 69: FileUpload1.SaveAs(saveFile)
Line 70:
Line 71: ' for product images we also create a thumbnail
The error message in your question gives you all the information you need - you need to give your ASP.NET account write access to the folder you are trying to access - the error message tells you exactly how to do this.
It seems you don't have access right to the path.
You need to change the access right and then test again.

Resources