ASP.NET Zone

Die ASP.NET Community. Alle Antworten rund um Microsoft® Webtechnologien
Willkommen bei ASP.NET Zone. Anmelden | Registrieren | Hilfe | Impressum | ASP.NET Zone Suchplugin

in
Home Blogs Foren FAQ Communities Fotos Downloads
Werbeanzeige

Applikation auf Server von ASP.NET aus ausführen

Letzter Beitrag 03-30-2012, 12:31 von Stefan Falz. 1 Antworten.
Beiträge sortieren: Zurück Weiter
  •  03-29-2012, 11:30 224111

    Applikation auf Server von ASP.NET aus ausführen

    Hallo zusammen,

    ich möchte gerne aus einer ASP.NET Anwendung heraus eine Applikation auf einem Server (Windows Server 2008 R2) starten. Diese Applikation führt ein Script auf dem Server aus und wird danach wieder geschlossen. Meine ASP Anwendung läuft auf einem IIS 7. Damit der IIS User die Berechtigung hat, die App auch auszuführen, habe ich der Gruppe IIS_IUSRS volle Zugriffsberechtigung auf das Installationsverzeichnis der Applikation gegeben.

    Dann bekomme ich folgenden Fehler:

    Retrieving the COM class factory for component with CLSID {2B9B8E92-EBAA-44AF-A23C-9FBD08EAFA54} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

    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 {2B9B8E92-EBAA-44AF-A23C-9FBD08EAFA54} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

    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 <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.


    Auch wenn ich "ASP.NET Impersonation" für meine Applikation einschalte und als User den Administrator angebe, bekomme ich einen Fehler:

    Creating an instance of the COM component with CLSID {2B9B8E92-EBAA-44AF-A23C-9FBD08EAFA54} from the IClassFactory failed due to the following error: 80070005.

    Die Beschreibung des Fehlers inst ansonsten die Gleiche. Irgendwie fehlt die Berechtigung für das erstellen eines COM Objekts.

    Bitte um Hilfe.

    Grüsse,

    kaktus

  •  03-30-2012, 12:31 224112 Antwort zu 224111

    AW: Applikation auf Server von ASP.NET aus ausführen

    Hi,

    es ist in der Regel keine gute (bzw. eigentlich sogar ziemlich schlechte) Idee, über ASP.NET externe Prozesse auf dem Server zu starten. Auf dem eigenen Webserver mag sowas noch funktionieren, da man dort die Berechtigungen verbiegen kann, auf einem Server bei einem Webhoster, auf den man keinen Rootzugriff hat, nicht.

    In deinem Fall musst Du die Berechtigungen über dcomcnfg anpassen. Du musst dir dort deine COM Komponente suchen und die Berechtigungen für den Aufrufer ändern. Was Du da wo genau wie einstellen musst, kann ich dir so nicht sagen, das hängt von der speziellen Komponente und deinen Anforderungen ab.

    Ein Hinweis noch: IIS ist ein Dienst und als ein solcher kannst Du schon gar keine Anwendung starten, die irgendwie mit dem Desktop interagieren würde. Also keine WinForms Anwendung, keine MessageBox, ... Eine reine Konsolenanwendung würde funktionieren. Da Du aber COM einsetzt, ist das Glückssache :)


    --
    Gruß, Stefan Falz
    Microsoft MVP - Visual Developer ASP/ASP.NET
    ASP.NET Consulting, Development, Coaching

    ASP.NET Zone - Leitfaden für gute Postings

    Xtopia 2008 - Gewinnspiel / Expression Studio und Xtopia Eintrittskarten zu gewinnen
Als RSS Feed in XML ansehen
Powered by Community Server (Commercial Edition)