mir344077, попробуйте проверить настройки того файла Excel, который открываете. На вкладке Рецензирование —> Доступ к книге уберите галочку «Разрешить изменять файл нескольким пользователям одновременно».
У меня была та же проблема: программа открывала файл Excel, выполняла нужные действия, сохраняла его под новым именем с параметром xlShared, закрывала, обрабатывала другие файлы, затем снова открывала пересохранённый файл, выполняла ещё действия, и снова сохраняла с параметром xlShared. Всё работало замечательно, таблички красиво заполнялись, пока не потребовалось при втором открытии нарисовать график. Строчка:
C++ | ||
|
Вызывала весьма неприятный (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)). Ни один из найденных в русско- и англоязычных источниках метод исправления к моему случаю не подошёл, ибо эта ошибка вызывается индивидуальными причинами (во многих источниках пишут, что даже на двух одинаковых компьютерах с одинаковой ОС, одинаковым ПО, одинаковыми настройками и правами доступа на одном компьютере ошибка может возникнуть, а на другом нет). К счастью, методом проб и ошибок (и долгого мучанья свеженького пустого файлика .xlsx) мне удалось вычислить, что краш Экселя на этой строчке вызывали именно настройки доступа к файлу xlShared. Причём сменить их пришлось в трёх местах:
1. Через Excel — в оригинальном файле
2. В коде программы при первом сохранении файла
3. В коде программы при втором сохранении файла
Поменять настройки в одном или даже двух местах оказалось недостаточно, файл должен иметь доступ xlExclusive на всём протяжении своего цикла взаимодействия с программой. Зато в результате графики заработали. Вот рабочий код для сохранения (для программ C++/CLI Windows Forms):
C++ | ||
|
Надеюсь, это поможет вам и/или ещё кому-нибудь победить ошибку сервера!
0
Содержание
- The server threw an exception ошибка
- The server threw an exception ошибка
- The server threw an exception ошибка
Thanks for the quick reply.
1. Where would I check for access rights? Is this the same as the machine’s .NET security policy files? The website assumes a user that has rights to read/write; it’s not an anonymous user.
2&3. I’m running this both via the web and through the localhost that VisualStudio provides.
I’ve written another post which details this a little more. Here it is:
I have been charged with creating a mini web portal where customers can register a product and in return, get a activation license. I’ve successfully developed the app on my WinXP SP2 laptop using: Visual Studio 2005, SQL 2005, C#. I am inheriting an assembly that was written in 2003 which is responsible for actually creating the license.
I call a function from this inherited .dll and receive the license without any error.
Once the site was near completion, I migrated it to my Win2003 Server (standard ed, SP2). I registered my .dlls and added them as references to my newly-created solution. I then compiled the site and got the following error:
Error:
System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData) at
LicenseKeyGen.LicenseKeyGeneratorClass.createLicenseBitString(String a_sFeatures, String a_sProductId, Int16 a_bEvaluationLicense, Int16 a_iEvalPeriod) at
XDAL.LicenseDAL.GetFinalLicense(String ParamFeatures, String productID, Int16 ParamEvaluation, Int16 ParamEvalPeriod) in
X:InetpubwwwrootxxxLicenseDAL.cs:line 394 at XDAL.LicenseDAL.GenerateLicenceKey(String productID) in
X:InetpubwwwrootxxxLicenseDAL.cs:line 303 at XDAL.LicenseDAL.MatchAndUpdate_ProdID_IKey(String productID, String Ikey) in
X:InetpubwwwrootxxxLicenseDAL.cs:line 628 at XDAL.LicenseDAL.GetLicense(String productid, String ikey, String email) in
X:InetpubwwwrootxxxLicenseDAL.cs:line 526 at XBus.License.GetLicense(String productid, String ikey, String email) in
X:InetpubwwwrootxxxLicense.cs:line 61 at _Products_Licensing_editProduct.btnSubmit_Click(Object sender, EventArgs e) in
X:InetpubwwwrootxxxeditProduct.aspx.cs:line 240
I then tried debugging to see if the correct parameters were being passed to the function. They are:
if you can’t see the image: 208.252.199.41/images/error-01.gif
After reading some microsoft forum posts I came across:
«I managed to solve this on our Windows 2003 machine. It seems that when you regasm the assembly, it won’t register the events interface unless you use the /tlb option. I don’t really understand it that well but this fixed it for us»
I then did this too:
if you can’t see the image: 208.252.199.41/images/error-02.gif
I am thoroughly baffled after 2 days of searching, Googling, calling colleagues, reading blogs, etc. There is so little documentation on System.Runtime.InteropServices.COMException (0x80010105) . Has anyone come across this error when transferring a site to a Win 2003 server?
Any advice/information would be GREATLY appreciated.
RPC_E_SERVERFAULT means that an exception occured on the server. So in order to understand what actually happened, you’ll need to debug the server. Presumably the call to LicenseKeyGeneratorClass.createLicenseBitString is the remote call. If you are saying that the LicenseKeyGeneratorClass is an in-proc server then you are probably invoking RPC due to cross-apartment marshalling. Anyway, the real exception is getting eaten by the marshalling infrastructure, so you need to attach a debugger and enable all exceptions so you can find it. If you are using the Visual Studio debugger, you will want to attach both the native and managed debuggers, turn off «just my code» in the debugger options, and enable catching of Win32, C++, and COM+ exceptions in the debugger. If you are getting too many spurious exceptions, you may need to put a breakpoint on the call to createLicenseBitString and wait to turn on exceptions until you hit the breakpoint. Anyway, grabbing the real exception may give you a better idea of what the problem is. If not, you are going to want to contact the folks who wrote your license key generator for support. That is where the exception is occuring, so they will be in the best position to help you out.
Microsoft VSTO Team
Did u find any solution for ur problem as i am passing through the same problem & dont know what to do
here is the problem:
I have an error appears System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
I have done dll with visual foxpro»due to an application done with it & database done with it» & made a service with c# it was working on Windows XP but while deploying it on windows server 2003 that error appears: System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)).
If know one knows the solution please help.
Thanks In advance.
Источник
The server threw an exception ошибка
I setup a SQL Server failover cluster using a domain user Domain User A (the domain user was added to local administrator groups of every node that are in the cluster)
Now I need to change the service account to an account with least privileges so I have created a new domain user B without adding it to the local administrator group of each node and have created SQL Server login for this account and assign sysadmin right to this account
I have also set access control list on those folders that this account needs to access by following the instructions on the web page «Setting up Windows Service Accounts» http://msdn.microsoft.com/en-us/library/ms143504%28v=sql.90%29.aspx
but when I set the service accounts (SQL Server and SQl Server Agent) to the new domain user B using the sql server configuration manager. I encountered this error «the server threw an exception [0x80010105]»
when I added the new domain users to the local administrator group of every node, I will not encounter this error.
does any one know any other permission that i need to assign to domain user B so that I do not need add them to the local administrator group of every node because i need to assign service accounts to an account with the least privileges
Add that mew login to sql server and make it sysadmin server role, then try change an account again
Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
I have already assigned sysadmin right to that account but error still occurred
In term of Os, what privileges do I need to assign to the new domain user except those privileges that I have already assigned
(Log on as a service (SeServiceLogonRight)
Act as part of the operating system (SeTcbPrivilege) (only on Windows 2000)
Log on as a batch job (SeBatchLogonRight)
Replace a process-level token (SeAssignPrimaryTokenPrivilege)
Bypass traverse checking (SeChangeNotifyPrivilege)
Adjust memory quotas for a process (SeIncreaseQuotaPrivilege)
Permission to start SQL Server Active Directory Helper
Permission to start SQL Writer
I added the new domain user to the local administrator group and start the service successfully
after starting the services sucessfully, I remove the domain user from the local administrator and restart the services and the sql server cannot start
I found an error in the sql server error log
Error: 17053, Severity: 16, State: 1.
UpdateUptimeRegKey: Operating system error 5(access is denied) encounter
any idea on how to solve this
I have assigned full control to all the folders that contains the word «SQL» and it still do not work
Just to ask what version of SQL is used here.. fyi SQLCAT paper extract here:
Service SIDs instead of Domain Groups on Windows Server 2008
A pain point for many DBAs was the introduced requirement in SQL Server 2005 Failover Clustering for using domain groups for SQL Server services. These domain groups were used to manage the permissions of the SQL Server service accounts; however they required that each domain group already contained the service accounts as members prior to install. Changing the domain group for a clustered service, although possible, was not a trivial procedure (see KB 915846, “Best practices that you can use to set up domain groups and solutions to problems that may occur when you set up a domain group when you install a SQL Server 2005 failover cluster”).
If you are creating a new SQL Server 2008 failover cluster on Windows Server 2008, you can now bypass the use of domain groups by designating Service SIDs during the install. Service SID functionality was introduced in Windows Vista and Windows Server 2008, and allows the provisioning of ACLs to server resources and permissions directly to a Windows service. On the «Cluster Security Policy» dialog during install of a SQL Server failover cluster, you still have the option to use domain groups, however selecting «Use service SIDS» is the recommended choice for SQL Server 2008 on Windows Server 2008 and allows you to bypass provisioning of domain groups and associated service account membership additions prior to installation.
Источник
The server threw an exception ошибка
I setup a SQL Server failover cluster using a domain user Domain User A (the domain user was added to local administrator groups of every node that are in the cluster)
Now I need to change the service account to an account with least privileges so I have created a new domain user B without adding it to the local administrator group of each node and have created SQL Server login for this account and assign sysadmin right to this account
I have also set access control list on those folders that this account needs to access by following the instructions on the web page «Setting up Windows Service Accounts» http://msdn.microsoft.com/en-us/library/ms143504%28v=sql.90%29.aspx
but when I set the service accounts (SQL Server and SQl Server Agent) to the new domain user B using the sql server configuration manager. I encountered this error «the server threw an exception [0x80010105]»
when I added the new domain users to the local administrator group of every node, I will not encounter this error.
does any one know any other permission that i need to assign to domain user B so that I do not need add them to the local administrator group of every node because i need to assign service accounts to an account with the least privileges
Add that mew login to sql server and make it sysadmin server role, then try change an account again
Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
I have already assigned sysadmin right to that account but error still occurred
In term of Os, what privileges do I need to assign to the new domain user except those privileges that I have already assigned
(Log on as a service (SeServiceLogonRight)
Act as part of the operating system (SeTcbPrivilege) (only on Windows 2000)
Log on as a batch job (SeBatchLogonRight)
Replace a process-level token (SeAssignPrimaryTokenPrivilege)
Bypass traverse checking (SeChangeNotifyPrivilege)
Adjust memory quotas for a process (SeIncreaseQuotaPrivilege)
Permission to start SQL Server Active Directory Helper
Permission to start SQL Writer
I added the new domain user to the local administrator group and start the service successfully
after starting the services sucessfully, I remove the domain user from the local administrator and restart the services and the sql server cannot start
I found an error in the sql server error log
Error: 17053, Severity: 16, State: 1.
UpdateUptimeRegKey: Operating system error 5(access is denied) encounter
any idea on how to solve this
I have assigned full control to all the folders that contains the word «SQL» and it still do not work
Just to ask what version of SQL is used here.. fyi SQLCAT paper extract here:
Service SIDs instead of Domain Groups on Windows Server 2008
A pain point for many DBAs was the introduced requirement in SQL Server 2005 Failover Clustering for using domain groups for SQL Server services. These domain groups were used to manage the permissions of the SQL Server service accounts; however they required that each domain group already contained the service accounts as members prior to install. Changing the domain group for a clustered service, although possible, was not a trivial procedure (see KB 915846, “Best practices that you can use to set up domain groups and solutions to problems that may occur when you set up a domain group when you install a SQL Server 2005 failover cluster”).
If you are creating a new SQL Server 2008 failover cluster on Windows Server 2008, you can now bypass the use of domain groups by designating Service SIDs during the install. Service SID functionality was introduced in Windows Vista and Windows Server 2008, and allows the provisioning of ACLs to server resources and permissions directly to a Windows service. On the «Cluster Security Policy» dialog during install of a SQL Server failover cluster, you still have the option to use domain groups, however selecting «Use service SIDS» is the recommended choice for SQL Server 2008 on Windows Server 2008 and allows you to bypass provisioning of domain groups and associated service account membership additions prior to installation.
Источник
- Remove From My Forums
-
Question
-
Hi All,
I am working on some excel automation logic. Basically it writes some values into various cells and runs a macro. This is to be repeated for each record in the database. for e.g. if the database has 100 records the macro has to be run 100 times after pumping values into cells. My problem is the application runs fine upto around 80 records and from there it is giving the following error and finally application is not able to close the workbook. The Excel.exe process is still running.
If I give 20 records each and run in 5 batches no problems.
The error is
System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
at Microsoft.Office.Interop.Excel.WorkbookClass.Close(Object SaveChanges, Object Filename, Object RouteWorkbook)The code looks something like this
Try
oExcel = GetExcelObject()
oWorkBook = GetWorkBook(oExcel, StrExcelFileName)
oWorkSheets = GetWorkSheets(oWorkBook)‘Loop through all the records
‘Write values into cells
‘run the macro‘End loop
Catch ex As Exception
Throw New Exception(ex.Message & ex.StackTrace)
Finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWorkSheets)
oWorkSheets = NothingoWorkBook.Close(False)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWorkBook)
oWorkBook = NothingoExcel.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oExcel)
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(oExcel)
oExcel = Nothing
End TryAny idea on how to resolve this. Please share your comments on this.
Thanks & Regards
Answers
-
You will notice that the exception is thrown from Workbook.Close.
Your main code throws some exception. You catch it and throw another exception. Now you call Close and that fails (I do not know why yet). If you want to know why the original data insertion failed, you would be better off eliminating the catch clause altogether and enabling first chance exceptions (Debug/Exceptions/Common Language Runtime). This way you will be able to see why the original exception was thrown.
iouri
—
This posting is provided as-is and confers no rights
-
Hello Shery,
maybe it has to do with the garbage collector.
We had a similar problem with Exchange RPC Connections and Outlook Objects.We use a workaround, we count the items processed and after e.g. 20 Items you do a GC.Collect().
So the Garbage Collector releases the references to COM Objects clearly, and you can go on with your work.
There’s also another approach. Since Excel objects still are COM Objects you can call explicitly a Marshal.ReleaseComObject (object) when you are finished with your e.g. workbook, so it’s release from memory also.
Hope this helps,
Greets, Helmut Obertanner
[http://www.x4u.de]
I’m using Pro DC Version 2021.001.20135.20135 on my Windows 10 desktop. My application is sturctured in C# Win Forms and has been able to open PDF documents without error for at least a year using the following code to open a pdf file without any problems:
acroAVDoc.OpenInWindowEx(OFDMain.FileName, PANPdf.Handle.ToInt32(), AV_DOC_VIEW, 1, 0, PDUseThumbs, AVZoomFitPage, 0, 0, 0);
Yesterday morning, there were no problems. However, after lunch, I started getting the following exception when trying to open a document after no changes to the code which was functional before lunch:
The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
I contacted Adobe Support and after about two hours of chatting with a service rep. and a reinstallation of Pro on my desktop, the problem still exists. I have tested the same code on my Windows 10 laptop and the code works fine with DC Pro Version 2021.001.20145. My secondary Windows 10 desktop uses Acrobat Pro 11 and also does not throw the exception when opening a file.
Any ideas what is wrong?
Table of Contents
- Applies to
- Introduction
- The Problem
- The solution
- Recap:
- Conclusion
- See Also
Applies to
This guide applies to System Center Orchestrator 2016
Introduction
Update Rollup 8 was released a few days ago for System Center 2016, however after applying the latest Update Rollup 8 for Orchestrator 2016, when you’re trying to run the Runbook Designer we receive an error and cannot open the Runbook Designer in any way.
There’s been a similar case earlier with the Update Rollup 4 for Orchestrator 2016, back then there was an additional step prior to installing the update rollup, the SQL
Server Native Client had to be installed.
However for Update Rollup 8, this is not the case.
The Problem
Once the update rollup 8 on the Orchestrator 2016 environment has been installed, we can no longer open the Runbook Designer, nor can we perform the Data Store Configuration. When opening the Runbook Designer we get «The server threw an exception»
error as shown below:
The first thing that might come in mind is to perform the Data Store Configuration.
Let’s go ahead and open the Data Store Configuration which can be found on the Orchestrator management server.
Once we’ve opened the Data Store Configuration, enter the servername and instance name of the Orchestrator database and then click Next.
Next we want to choose «Use an existing data store«, however when selecting this option we receive the following error: «Could not connect to the specified database server» as shown below:
The solution
When reading the KB article for the Update Rollup 8 for System Center 2016 Orchestrator, under the “How to obtain Update Rollup 8 for System Center
2016 Orchestrator” section there is an important mentioning:
«Important Before you install this update, make sure new SQL driver (MSOLEDBSQL) is installed on the Management server role. For more information, see the Microsoft
OLE DB driver for SQL Server topic on the Microsoft Docs website.»
The link however doesn’t redirect us to any download link for the Microsoft OLE DB Driver for SQL Server, it goes to the documentation page.
What we need to download is the following package:
- Microsoft OLE DB Driver 18 for SQL Server
Once we’ve installed the Microsoft OLE DB Driver 18 on the Orchestrator management server, we will need to perform the Data Store Configuration before accessing the Runbook Designer.
We are now able to select the existing data store:
Then click Finish and we should shortly receive an identical window as shown below:
Recap:
If you have installed Update Rollup 8 already on the Orchestrator management servers:
- Download and install Microsoft OLE DB Driver 18 for SQL Server.
- Run the Data Store Configuration.
- Open the Runbook Designer.
If you have not yet installed the Update Rollup 8 on the Orchestrator management servers:
- Download and install Microsoft OLE DB Driver 18 for SQL Server.
- Download and install the Update Rollup 8 for Orchestrator 2016.
- Run the Data Store Configuration.
- Open the Runbook Designer.
Conclusion
Always carefully go through the KB article for each update/update rollup before installing the update, there are things that may be easily missed otherwise.
As a good practice it’s also recommended to make sure to have backups before applying a bigger update such as an Update Rollup.
See Also
- Upgrading to Orchestrator 2019 Step-by-Step
- System Center Orchestrator Troubleshooting: «Database Configuration»
error when installing a Runbook Server - Update Rollup 8 for System Center 2016 has been released!