I am using component of Microsoft.Office.Interop.Word.dll on C#.But when i run it on IIS,I am receiving the following error.
Retrieving the COM class factory for component with
CLSID {000209FF-0000-0000-C000-000000000046} failed
due to the following error: 80070005.
if I allow 32-bit applications on IIS,I am receiving the following error.
”Validation of viewstate MAC failed. If this application is
hosted by a Web Farm or cluster,
ensure that <machineKey> configuration specifies the
same validationKey and validation algorithm.
AutoGenerate cannot be used in a cluster”
I am entering the following line into web.config file.
<system.windows.forms jitDebugging="true"/>
if I run again , that's gives me error.
Microsoft Word encountered a problem.
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.Runtime.InteropServices.COMException:
Word encountered a problem.
Source Error:
Line 711:
Line 712: //ADDING A NEW DOCUMENT TO THE APPLICATION
Line 713: oWordDoc = oWord.Documents.Add(ref yol, ref oMissing,
ref oFalse, ref oTrue);
Line 714:
Line 715: // SELECT END
By the way, I am using IIS 7 64-bit on Windows Server 2008.
How can i solve this problem?
Thanks in advance.
Error (or HRESULT) 0x80070005 translates to E_ACCESSDENIED which means you've got a permissions problem somewhere.
Make sure your web site's identity has permissions to access Word.
Also make sure your application pool's enable32BitOppOnWin64 setting is configured to match whatever processor architecture your Word app is targeted at.
Related
I have a simple web app that interacts with a Microsoft SQL Server 2016 Standard Edition that is hosted on it's own server, in the same environment. When I run the app locally, it connects just fine and posts to the DB with no problem. After I published the app to our app hosting server I get the following error:
error: 52 - Unable to locate a Local Database Runtime installation.
I'm wondering why it is even talking about a local database when I am connected to a DB on a server, which was initially working. I know the connectionString works because it connects to the DB and posts just fine from localhost.
<connectionStrings>
<add name="PickemContext" connectionString="Data Source=ISSQLTEST01; user id=pickem; Password=pickem"
providerName="System.Data.SqlClient" />
</connectionStrings>
Here is the error.
The system cannot find the file specified
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.ComponentModel.Win32Exception: The system cannot find the file specified
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:
[Win32Exception (0x80004005): The system cannot find the file specified]
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)]
And it keeps going with more stuff in the stack trace.
How can I go about troubleshooting this? Its confusing to me that it works and posts to the DB just fine from localhost but throws an error talking about localDBs when trying to post from the hosted app. When looking at the table data displayed on the hosted app, it loads everything in fine, all the data that's in this table. The problem just seems to be with posting.
Ok I fixed the issue. The issue was not my connection string in Web.config. When I was making the app, I had to add some functionality to the Create method in the controller, and I had set a "conString" String variable because parts of this method needed the connectionString. This variable was still holding the original connectionString which points to a localDB. I just replaced that with the proper connectionString and now it is all good.
Well, I have two projects:
Blog.Core (a class library project for my entites as well as data access code)
Blog (ASP.NET MVC Project)
I installed EF in Blog.Core. Then added reference to Blog.Core in Blog. I have specified my connection string in Blog.Core since this is my DAL. Now when I run the project I get the following error:
An exception of type 'System.Data.SqlClient.SqlException' occurred in EntityFramework.dll but was not handled in user code
Additional information: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
I deleted the connection string form Blog.Core and placed it in Blog project, and it works. Why is that? Doesn't this break the architecture because client-side has the database connection string? I mean isn't that correct that only DAL should be responsible for connection strings and database operations. Why was my first (and, according to me, more logical) solution not working?
There has been lots of argument about this one and you can refer to this thread C# DLL config file
I need to run an executable from an ASP.NET app using Process. The .exe file is located inside the ASP.NET project - 'ProjectRoot/Utilities/utility.exe'
Why does this code fail to run it:
string path = Server.MapPath("/Utilities/");
string args = " etc etc";
Process p = Process.Start(new ProcessStartInfo(path + "utility.exe", args));
p.WaitForExit(3000);
I've tried "\\utility.exe" too.
The answer depends on the type of the occuring exception. By the way, if the identity of application pool (which is the equal position to the process in a windows app) is set to a limited user (as it is by default) you can not execute a process on the server because of security issues.
If you know about the consequences and the server is your own, you can change the identity of the application pool to an authorized user, then your application can do such a thing without any hesitation.
Cheers
There's a few things to check here.
The first thing is to ensure that string path = Server.MapPath("/Utilities/"); is a valid path and that utility.exe is in the correct location.
You said that it does not throw an exception, so the invocation of utility.exe should at least be valid. However, utility.exe may swallow any exceptions it in turn encounters (depends on how it was coded), which may be why it does not appear to be working.
On top of that, your args variable may be specifying a file or some other resource that utility.exe accesses. If it does swallow exceptions, it could be masking a permissions error if the application pool identity does not have access to the resouce.
I am building a site using fluent NHibernate, which works just fine on the dev box.
However, after I uploaded it to my host I get the following when trying to run it.
"System.TypeInitializationException: The type initializer for 'NHibernate.ByteCode.Castle.ProxyFactory' threw an exception. ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.
Is this something I will need to resolve with the hosting company (CrystalTech)?
Any help much appreciated.
The rest of the inner exception:
at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly, String strongAssemblyName, String strongModulePath, String weakAssemblyName, String weakModulePath) at Castle.DynamicProxy.ModuleScope..ctor(Boolean savePhysicalAssembly) at Castle.DynamicProxy.ProxyGenerator..ctor() at NHibernate.ByteCode.Castle.ProxyFactory..cctor() The action that failed was: LinkDemand The Zone of the assembly that failed was: MyComputer
--- End of inner exception stack trace ---
nHibernate does not work out of the box on a medium-trust environment (which most shared hosts run your application under). Lazy Loading with nHibernate Under Medium Trust describes some of the steps taken to try to get it working.
Background: I'm calling a Web Service written in ASP.NET that queries an Oracle database. I know the Web Service itself works, because I've used it before other applications. So I have a web application in Visual Studio that I've been switching back and forth to point from a 'DEV' web service to a production configured version of the same web service for testing. Pointing to the 'DEV' configured web service is no problem, but calling the production version I always get an exception calling the service:
SoapException was unhandled by user code
Server was unable to process request. ---> could not execute query
[ SELECT this_.FIELD1 as FIELD1_18_0_, this_.FIELD2 as FIELD12_18_0_ FROM ABC.TABLE_A this_ WHERE this_.FIELD1 like :p0 ORDER BY this_.FIELD1 asc ]
Positional parameters: #0>00073%
[SQL: SELECT this_.FIELD1 as FIELD1_18_0_, this_.FIELD2 as FIELD12_18_0_ FROM ABC.TABLE_A this_ WHERE this_.FIELD1 like :p0 ORDER BY this_.FIELD1] ---> ORA-12571: TNS:packet writer failure
I ran the SQL queries against the appropriate database (cut and pasted straight out of the exception message) and the query came back with the expected data. I've tried updating and re-adding the Web Service reference both as a "Service Reference" (.NET 3.0+ way) and as a "Web Reference" (Older .NET way), and both give the same error.
Question: So, what does a "ORA-12571: TNS:packet writer failure" error mean in the context of a Web Service? Looking up the Oracle Error number gives some very vague possible causes such as "loose cable connection" or "IP address conflict". I'm fairly certain it's neither of these, since a different application is currently successfully using that Web Service. Possibly some kind of configuration error, or maybe something more subtle? Anyone else seen this vexing Oracle error number being attributed to something web-service related?
Your call is going from the ws client to the ws server to the oracle database.
Your error is an ORA error, which is generated by the database. So your problem is probably between the ws server and the database.
When you ran "the SQL queries against the appropriate database", did you do it from the web server? If not could you try that. Make sure that you are using the same connection configuration.
EDIT
As per the comment below, the real problem was a driver mismatch.
I would suggest re-examining your assumptions more carefully, as this is clearly an error in the web-service dialogue with the db and should be completely independent of the w/s caller.
If the w/s call is generating this specific exception, it should be doing so for all other invocations, so your 'other application' that's using the web service successfully is simply not executing the same code or there are outside factors at play.
Either way, it's unrelated to how the service is registered or invoked.