Outlook COMException - outlook-object-model

Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
Could any body please help me out by finding the error. I have created a windows application using OUtlook COM with Office 2010. I have a timer which after a specific interval takes the data from sql server database and then add up into the sql server database. But my applicatio is giving this exception when i am creating the object of Outlook.Application class.

This might be due to privileges of the process. I usually run Visual studio as administrator, but if outlook is not previously started as also admin, the COM call will fail.
Simple solution. Run both as administrator or run both as normal privilege level.

Related

Script task Issue

I have a script task that picks up an excel file and references Microsoft.office.interop.excel which is all fine. It runs fine on my workstation but when I deploy this to server it errors.
Script Task:Error: Retrieving the COM class factory for component with
CLSID {00024500-0000-0000-C000-000000000046} failed due to the
following error: 80040154 Class not registered (Exception from
HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I have checked that the proxy account has access to the excel location. I have also made sure the package is running in 32Bit mode on the server and in my debug environment, which, as I say works fine in debug but as soon as I deploy to server it fails. I have also checked to make sure that Microsoft.office.interop.excel exists in the GAC and is the same version.
I am at a loss as to what the problem here is.... Anyone got any ideas?
Thanks

EF Core migration on app start fails with "login failed" but works via package manager console

We have multiple applications that use EF Core Code First. Earlier, the databases were created automatically on my local Sql Server 2019 when I first debugged an application locally from Visual Studio 2022. Now that stopped working for some reason and I get the following error message:
Cannot open database "XX" requested by the login. The login failed.
Login failed for user 'Domain\user'.
An example connection string is (I also tried adding Trusted_Connection=True; at the end, doesn't change anything):
Data Source=localhost;Initial Catalog=XX;Integrated Security=true
When I use the package manager console "Update-Database" command, the databases are created as expected and all migrations are executed.
Also, I can create databases with the same user 'Domain\user' via SQL Server Management Studio.
One more thing that I noticed is that I get a different error message if I first create an empty database via SSMS and then start the application. In this case no migrations are performed and the error message is (where Events is some table the application uses):
'Invalid object name 'Events'.'

Fix this Entity Framework migration, 00000000000000_CreateIdentitySchema, in Visual Studio?

I'm starting with the default Blazor app in Visual Studio 16.3.7 with authentication:
I go to the registration page, enter the email and password, and click the Register button and up comes the following error:
Next I go to Package Manager Console in Visual Studio, and run Update-Database, getting the following error:
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Users\Halaspnet-BlazorAuthentication-0X0X0X0X0X0-X0X0-X0X0-X0X0-0X0X0X0X0X0.mdf'.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
The message points to the culprit, a backslash is missing from the file specification. It should be C:\Users\Hal\aspnet... , not C:\Users\Halaspnet...
So, how do I fix this? I can't find the string "CREATE DATABASE" anywhere in my solution.
Also, how do I get this to Microsoft as a bug report?
Problem solved!
I created the database that the 00000000000000_CreateIdentitySchema.cs wanted using Visual Studio's SQL Server Object Explorer. Then I ran Update-Database in the Package Manager Console, and it completed successfully.
The problem seems to be that I was using the Express edition of SQL Server.
This link got me to the fix for this problem:
Creating A Step-By-Step End-To-End Database Server-Side Blazor Application

SQL Agent can't run package with WMI Event Watcher Task

I created a SSIS package that watches for files being created on another server using a WMI Event Watcher Task. This package works fine when I run it in VS. It works fine when I manually Execute it from the Integration Services Catalog. When I try to run it as a scheduled SQL Agent Job I get
Error: Watching for the Wql query caused the following system exception: "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))". Check the query for errors or WMI connection for access rights/permissions.
My question is why does this not run as a SQL Agent Job when I can run it successfully several different ways? Based on the error code seems to be a COM/DCOM security issue.
So far I have:
Tried many web sites most are more or less like this
https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-troubleshooting?redirectedfrom=MSDN I have followed all the instructions on these websites with no change.
Gone back and gave even more permissions then specified by the website to the COM Limits and DCOM Config of the Windows Management and Instrumentation.
Have restarted the WMI service on the other server several times after each change.
Tried SA and myself as owner of the Job.
Tried my usual SQL Agent Proxy account and the default Server Agent Service Account (which is a Managed Service Account) as the Run As for the package.
Tried running as a 32 and 64 bit runtimes.
Have made the SQL Agent Proxy account and Server Agent Service Account Admins on the other server.
Tried hard coding my user name and password into the Connection Manager and used Windows Authentication.
* New tests *
Tested the SQL Agent Job using the File System as the package source instead of the SSIS Catalog, still failed with same error.
Tested running package using the Execute Package Utility and it worked!
The AgentSqlServer user does not have rights to launch WMI Querys on server, You should create a proxy account and join it à to the step on the SQL Job.

Error authenticating proxy while running agent job

I am trying to schedule a SSIS2014 package via SQL Server Agent job. Both SSIS and SSMS are running on my local machine in the same domain. I am running SSMS with the same user Domain\Admin which is the creator of the SSIS package. SSMS 32-Bit and SSIS 32-Bit are running on Windows 7 64-Bit machine. I can run the package within SSIS without problems.
Using Microsofts KB article http://support.microsoft.com/kb/918760 and tutorial video http://technet.microsoft.com/en-us/library/dd440760%28v=sql.100%29.aspx I tried a couple of methods (proxy, configuration file, EncryptSensitiveWithPassword) but none of them worked for me.
When I use a proxy account to run the job step, the following message occurs:
Unable to start execution of step 1 (reason: Error authenticating proxy
`Domain\Admin`, system error: Logon failure: unknown user name or bad password.).
The step failed.
The proxy account uses the credentials identity Domain\Admin. Since the password fields for credential properties in SSMS cannot be left blank, I typed any password although my corresponding windows account has no password. So as mentioned above it's the same user account that created the SSIS package since Domain\Admin is stated in the CreatorName property of the SSIS package.
With this proxy, I tried to run SSIS jobs using the package ProtectionLevel's EncryptSensitiveWithUserKey and EncryptSensitiveWithPassword. Running the package manually within SSDT without problems, but from SSMS agent job the same error message appears. I tried the package sources "File System" and, after importing the package to MSDB, "SQL Server" and "SSIS Package Store". But exactly the same error message appears with each method.
Task manager shows that SSMS is running in administrator mode. Using Windows Component Services I added DCOM permissions for Domain\Admin to start and activate "Microsoft SQL Server Integration Services 12.0" from local. But the same error message appears. So in my opinion it's a problem with SSMS user account permissions (???) but unfortunately I don't know what exactly to do here. I tried the following:
In the system database MSDB (full path: Databases / System Databases / MSDB / Security / Logins) I assigned all available role memberships (Including db_ssisoperator, db_ssisltduser, db_ssisadmin) to Domain\Admin.
In server security (full path: Security / Logins) I assigned all available server roles. In the tab User Mapping, I assigned the MSDB database.
Still the same error message appears when I try to run the job. Does anybody have some ideas what I can try?

Resources