System.IO.FileLoadException from WshShell.Exec in classic ASP on IIS 7.5

Im using DidiSoft OpenPGP library for .NET to compile C # to exe, which is run by classic ASP. The goal is to update the security on this legacy website to use PGP. Its an old site, so we cannot rewrite it without significant costs.

The reason I tried to use this library was because when we called the compiled C # EXE that were referenced:

using System.Security.Cryptography;

I would get empty output in ASP, and IIS will throw an error in the event log like this:

Faulting application name: PGPTest.exe, version: 1.0.0.51, time stamp: 0x52f28ee5 
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18229, time stamp: 0x51fb1116 
Exception code: 0xe0434352 
Fault offset: 0x0000c41f 
Faulting process id: 0x5f08 
Faulting application start time: 0x01cf22a83ae734f4 
Faulting application path: d:\inetpub\_bin\[redacted website name]\PGPTest.exe 
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll 
Report Id: 789751fa-8e9b-11e3-87e1-0050568e508f
Application: PGPTest.exe 
Framework Version: v4.0.30319 
Description: The process was terminated due to an unhandled exception. 
Exception Info: System.IO.FileLoadException
Stack: 
   at PGPTest.Program.Main(System.String[])
================
.NET Runtime version 4.0.30319.1008 - There was a failure initializing profiling API attach infrastructure.  This process will not allow a profiler to attach.  HRESULT: 0x80004005
Process ID (decimal): 24328.  Message ID: [0x2509].

Therefore, when I use either DidiSoft OpenPGP or System.Security.Cryptography, I get errors.

In classic ASP, the application is invoked with:

WshShell.Exec(%pathtoexe%) 

IF, LocalSystem NetworkService. , , .

:

  • 2008 R2
  • .NET 4.0

, LocalSystem ; ? , ?

: , System.Security.Cryptography.

2: : , , ASP. , ? #, Classic ASP ASP.NET 4 Web API, . , ASP.

, , System.Security.Cryptography ASP.NET Web API. POST ASP.NET ASP; , : http://www.aspjson.com/

+3
1

, , LocalSystem . filemon processmon , , .

http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

0

All Articles