none
System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105

    Question

  • Help!!!

    I'm at my wit's end.

     

    For the past few months I've been creating a website which takes in a user's product serial number, along with another "key" string, and then generates a license.  This generated license unlocks the user's appliance; it is non-functional before it's registered.

     

    The license is generated by a COM .dll which calls the appropriate algorithms based on the user's inputs.

     

    This code works perfectly on my laptop!  When I migrated it to a true development/staging server I was not able to generate a license.  I've gone through the same exact procedure that I did when installing the necessary COM .dlls on my laptop.

     

    1. I registered the DLL

    2. Added a reference in Visual Studio 2005

     

    Nonetheless, here's the 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
    xxx.xxx.createLicenseBitString(String a_sFeatures, String a_sProductId, Int16 a_bEvaluationLicense, Int16 a_iEvalPeriod) at
    xxx.xxx.GetFinalLicense(String ParamFeatures, String productID, Int16 ParamEvaluation, Int16 ParamEvalPeriod) in C:\Inetpub\wwwroot\...\LicenseDAL.cs:line 394 at xxx.xxx.GenerateLicenceKey(String productID) in
    C:\Inetpub\wwwroot\...\LicenseDAL.cs:line 303 at xxx.xxx.MatchAndUpdate_ProdID_IKey(String productID, String Ikey) in
    C:\Inetpub\wwwroot\...\LicenseDAL.cs:line 628 at xxx.xxx.GetLicense(String productid, String ikey, String email) in
    C:\Inetpub\wwwroot\...\LicenseDAL.cs:line 526 at xxx.xxx.GetLicense(String productid, String ikey, String email) in
    C:\Inetpub\wwwroot\...\License.cs:line 61 at _Products_Licensing_editAccelerator.btnSubmit_Click(Object sender, EventArgs e) in
    e:\Inetpub\wwwroot\...aspx.cs:line 240

     

    One thing to note, could this be a descrepancy in drive Letters?  C:\  vs.  E:\

     

    ANY ADVICE IS MUCH APPRECIATED!

    Tuesday, June 19, 2007 6:48 PM

Answers

  • Hi,

     

    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.

     

    Sincerely,

     

    Geoff Darst

    Microsoft VSTO Team

    Thursday, June 21, 2007 4:15 PM

All replies

  • Hello fsilva,

     

    it's not an VSTO issue,

    however for me it seems that the COM dll cant access a network share or another COM+ component or a Webservice.

    RPC -> RemoteProcedureCall

    Do you have the sources to this DLL ?

    If not maybe you can use a networkmonitor to see what the Dll tries to access.

    Do you need an Internetconnection for it ?

    If the COM dll is called from a website - the process wich is calling the dll maybe has:

    - no rights to access another networkresource because it is executed with anonymous user rights

    - no correct internetsettings for this useraccount

    - a firewall between the webserver and the resource

     

    Also I would check the security log on the webserver and maybe on a firewall if some access was blocked.

     

    Hope this helps,

    greets, Helmut

    Tuesday, June 19, 2007 7:17 PM
  • Helmut,

     

    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:\Inetpub\wwwroot\xxx\LicenseDAL.cs:line 394 at XDAL.LicenseDAL.GenerateLicenceKey(String productID) in
    X:\Inetpub\wwwroot\xxx\LicenseDAL.cs:line 303 at XDAL.LicenseDAL.MatchAndUpdate_ProdID_IKey(String productID, String Ikey) in
    X:\Inetpub\wwwroot\xxx\LicenseDAL.cs:line 628 at XDAL.LicenseDAL.GetLicense(String productid, String ikey, String email) in
    X:\Inetpub\wwwroot\xxx\LicenseDAL.cs:line 526 at XBus.License.GetLicense(String productid, String ikey, String email) in
    X:\Inetpub\wwwroot\xxx\License.cs:line 61 at _Products_Licensing_editProduct.btnSubmit_Click(Object sender, EventArgs e) in
    X:\Inetpub\wwwroot\xxx\editProduct.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.
    Wednesday, June 20, 2007 8:10 PM
  • Hi,

     

    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.

     

    Sincerely,

     

    Geoff Darst

    Microsoft VSTO Team

    Thursday, June 21, 2007 4:15 PM
  • Dears,

    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.


    Here Also the error that appears:
    Server Error in '/DemoSite' Application.
    --------------------------------------------------------------------------------

    System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
      at demoship1.DemoshipClass.Getconf(String mzdat1, String mship)
      at Service.GetOccupancyNumber(String Date, String ShipName) in c:\ServiceDemo\App_Code\Service.cs:line 22
      --- End of inner exception stack trace ---
    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.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
      at demoship1.DemoshipClass.Getconf(String mzdat1, String mship)
      at Service.GetOccupancyNumber(String Date, String ShipName) in c:\ServiceDemo\App_Code\Service.cs:line 22
      --- End of inner exception stack trace ---

    Source Error:


    Line 44:         [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOccupancyNumber", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    Line 45:         public object GetOccupancyNumber(string Date, string ShipName) {
    Line 46:             object[] results = this.Invoke("GetOccupancyNumber", new object[] {
    Line 47:                         Date,
    Line 48:                         ShipName});
     

    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\demosite\ca641922\164061aa\App_WebReferences.ue7oj3r6.0.cs    Line: 46

    Stack Trace:


    [SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))
       at demoship1.DemoshipClass.Getconf(String mzdat1, String mship)
       at Service.GetOccupancyNumber(String Date, String ShipName) in c:\ServiceDemo\App_Code\Service.cs:line 22
       --- End of inner exception stack trace ---]
       System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +533462
       System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204
       DemoService.Service.GetOccupancyNumber(String Date, String ShipName) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\demosite\ca641922\164061aa\App_WebReferences.ue7oj3r6.0.cs:46
       _Default.Button1_Click(Object sender, EventArgs e) in c:\TestingDemo\Default.aspx.cs:20
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

     


    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
    Tuesday, March 17, 2009 3:32 PM
  • I was obsessed with the same question just now, and finally I found the anwser: it all because I delivered some null string value as parameters to the method, which then resulted in the exception:System.Runtime.InteropServices.COMException: The server threw an exception...

    so, check if your situation is similar to mine, may it help.

    Friday, November 11, 2011 7:59 AM