JIT Debugging error when trying to exec app external to ASP.NET

G

Guest

I'm trying to exec a program external to my ASP.NET app using the following
code. The external app is a VB.NET application.

Dim sPPTOut As String
sPPTOut = MDEPDirStr + sID + ".ppt"
Dim p As New System.Diagnostics.Process

'p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)

The problem is that the two commented lines generate:

JIT Debugging failed with the following error: Access is denied.

errors. The uncommented exec of CALC.EXE works w/o issue. Running
macrun.exe from a command prompt works w/o issue.

Big picture is that I'm creating a PowerPoint file on the server and after
saving it to the server file system I need to run a macro embedded in the
PPT. macrun.exe opens the PPT and runs the macro.

I've tried other methods of execing the program with similar results:

Shell("C:\WINDOWS\SYSTEM32\CALC.EXE")
'Shell(MDEPDirStr & "macrun.exe", sPPTOut)
'Shell(MDEPDirStr & "macrun.exe " & sPPTOut)

Dim sPPTOut As String
sPPTOut = MDEPDirStr + sID + ".ppt"
Dim listFiles As System.Diagnostics.Process
listFiles = System.Diagnostics.Process.Start(MDEPDirStr &
"macrun.exe", sPPTOut)
listFiles.WaitForExit(2000)
If listFiles.HasExited Then
'Dim output As String = myOutput.ReadToEnd
'Debug.WriteLine(output)
End If
 
S

Steven Cheng[MSFT]

Hi Snicks,

Welcome to ASPNET newsgroup.
From your description, you're using the System.Diagnostics.Process class to
execute an external custom program(exe file) fomr your asp.net web
application. However, you're getting Access Denied error when executing
that app , yes?

Based on your description on the custom program "macrun.exe" which will
create PPT file and running macro, I think it is likely the running process
idenitity dosn't have sufficient permission to create/modify certain folder
since it has file accessing operations in it...... When you use the .net's
System.Diagnostics.Process class to executing a new process, it will
inherit the security context(process idenitity) from the parent process
(the ASP.NET worker process), so running that external app from asp.net app
is different from command line(which running under the current logon
user....). What's the server version and IIS version you're developing
with and what's the current process identity of your asp.net app( have you
used impersonate or not...)...

BTW, you can consider using Filemon tool to monitor the file accessing on
the server when your asp.net app try executing that custom program...
Filemon can capture the file accessing failure and we can have a look at
the path and security identity that cause the problem...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| Thread-Topic: JIT Debugging error when trying to exec app external to
ASP.NET
| thread-index: AcYb7UwHqXxLD2gjT0SDeLkAA9SJ5g==
| X-WBNR-Posting-Host: 66.160.85.199
| From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| Subject: JIT Debugging error when trying to exec app external to ASP.NET
| Date: Tue, 17 Jan 2006 21:09:02 -0800
| Lines: 40
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:371623
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm trying to exec a program external to my ASP.NET app using the
following
| code. The external app is a VB.NET application.
|
| Dim sPPTOut As String
| sPPTOut = MDEPDirStr + sID + ".ppt"
| Dim p As New System.Diagnostics.Process
|
| 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
| p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
| 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
|
| The problem is that the two commented lines generate:
|
| JIT Debugging failed with the following error: Access is denied.
|
| errors. The uncommented exec of CALC.EXE works w/o issue. Running
| macrun.exe from a command prompt works w/o issue.
|
| Big picture is that I'm creating a PowerPoint file on the server and
after
| saving it to the server file system I need to run a macro embedded in the
| PPT. macrun.exe opens the PPT and runs the macro.
|
| I've tried other methods of execing the program with similar results:
|
| Shell("C:\WINDOWS\SYSTEM32\CALC.EXE")
| 'Shell(MDEPDirStr & "macrun.exe", sPPTOut)
| 'Shell(MDEPDirStr & "macrun.exe " & sPPTOut)
|
| Dim sPPTOut As String
| sPPTOut = MDEPDirStr + sID + ".ppt"
| Dim listFiles As System.Diagnostics.Process
| listFiles = System.Diagnostics.Process.Start(MDEPDirStr &
| "macrun.exe", sPPTOut)
| listFiles.WaitForExit(2000)
| If listFiles.HasExited Then
| 'Dim output As String = myOutput.ReadToEnd
| 'Debug.WriteLine(output)
| End If
|
|
|
 
G

Guest

I'm running the dev env on my local machine - XP. I tried to run filemon.exe
from start\run but it was not found. I checked the World Wide Web Publishing
service and it is running C:\WINDOWS\system32\inetsrv\inetinfo.exe.
inetinfo.exe has a file version of 5.1.2600.2180 and same product version.
The ASPNET user is a member of the users group. ASP.NET State Service was
actually not started but it was setup to log on as NT
AUTHORITY\NetworkService. I started the ASP.NET State Service, tried
reruning the app and received the same error.

Thanks Steven
 
S

Steven Cheng[MSFT]

Thanks for your response Snicks,

So your dev box is WINXP, by default the ASP.NET running process idenitity
should be machine/ASPNET account... You can check the "aspnet_wp.exe"
process's account in task manager when running asp.net application to
confirm this....

Also, the filemon tool is not a build-in tool, you need to download it from
sysinternals website, it's a freeware:

#Filemon for Windows
http://www.sysinternals.com/utilities/filemon.html

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| Thread-Topic: JIT Debugging error when trying to exec app external to
ASP.NE
| thread-index: AcYcMQ0oqtE3o4bGSFmKIjWCBejojA==
| X-WBNR-Posting-Host: 66.160.85.199
| From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: JIT Debugging error when trying to exec app external to
ASP.NE
| Date: Wed, 18 Jan 2006 05:14:02 -0800
| Lines: 120
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:371708
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm running the dev env on my local machine - XP. I tried to run
filemon.exe
| from start\run but it was not found. I checked the World Wide Web
Publishing
| service and it is running C:\WINDOWS\system32\inetsrv\inetinfo.exe.
| inetinfo.exe has a file version of 5.1.2600.2180 and same product
version.
| The ASPNET user is a member of the users group. ASP.NET State Service
was
| actually not started but it was setup to log on as NT
| AUTHORITY\NetworkService. I started the ASP.NET State Service, tried
| reruning the app and received the same error.
|
| Thanks Steven
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Snicks,
| >
| > Welcome to ASPNET newsgroup.
| > From your description, you're using the System.Diagnostics.Process
class to
| > execute an external custom program(exe file) fomr your asp.net web
| > application. However, you're getting Access Denied error when executing
| > that app , yes?
| >
| > Based on your description on the custom program "macrun.exe" which will
| > create PPT file and running macro, I think it is likely the running
process
| > idenitity dosn't have sufficient permission to create/modify certain
folder
| > since it has file accessing operations in it...... When you use the
net's
| > System.Diagnostics.Process class to executing a new process, it will
| > inherit the security context(process idenitity) from the parent process
| > (the ASP.NET worker process), so running that external app from asp.net
app
| > is different from command line(which running under the current logon
| > user....). What's the server version and IIS version you're
developing
| > with and what's the current process identity of your asp.net app( have
you
| > used impersonate or not...)...
| >
| > BTW, you can consider using Filemon tool to monitor the file accessing
on
| > the server when your asp.net app try executing that custom program...
| > Filemon can capture the file accessing failure and we can have a look
at
| > the path and security identity that cause the problem...
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| > --------------------
| > | Thread-Topic: JIT Debugging error when trying to exec app external to
| > ASP.NET
| > | thread-index: AcYb7UwHqXxLD2gjT0SDeLkAA9SJ5g==
| > | X-WBNR-Posting-Host: 66.160.85.199
| > | From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| > | Subject: JIT Debugging error when trying to exec app external to
ASP.NET
| > | Date: Tue, 17 Jan 2006 21:09:02 -0800
| > | Lines: 40
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:371623
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I'm trying to exec a program external to my ASP.NET app using the
| > following
| > | code. The external app is a VB.NET application.
| > |
| > | Dim sPPTOut As String
| > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | Dim p As New System.Diagnostics.Process
| > |
| > | 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
| > | p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
| > | 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
| > |
| > | The problem is that the two commented lines generate:
| > |
| > | JIT Debugging failed with the following error: Access is denied.
| > |
| > | errors. The uncommented exec of CALC.EXE works w/o issue. Running
| > | macrun.exe from a command prompt works w/o issue.
| > |
| > | Big picture is that I'm creating a PowerPoint file on the server and
| > after
| > | saving it to the server file system I need to run a macro embedded in
the
| > | PPT. macrun.exe opens the PPT and runs the macro.
| > |
| > | I've tried other methods of execing the program with similar results:
| > |
| > | Shell("C:\WINDOWS\SYSTEM32\CALC.EXE")
| > | 'Shell(MDEPDirStr & "macrun.exe", sPPTOut)
| > | 'Shell(MDEPDirStr & "macrun.exe " & sPPTOut)
| > |
| > | Dim sPPTOut As String
| > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | Dim listFiles As System.Diagnostics.Process
| > | listFiles = System.Diagnostics.Process.Start(MDEPDirStr &
| > | "macrun.exe", sPPTOut)
| > | listFiles.WaitForExit(2000)
| > | If listFiles.HasExited Then
| > | 'Dim output As String = myOutput.ReadToEnd
| > | 'Debug.WriteLine(output)
| > | End If
| > |
| > |
| > |
| >
| >
|
 
G

Guest

I checked aspnet_wp.exe in the task manager and the user name is ASPNET.
I've downloaded filemon and it produces lots of data :) Outside of looking
at the filemon output do you have any suggestions based upon the information
I've provided so far?

If the filemon log is required what should I send and how. Recording just a
few seconds generated a 1.6MB file.

Below is the code involved. Maybe you could just compile a VB.NET app with
the macrun exe code and plug the asp.net code into an existing web site.

Thanks Steven.

<begin asp.net code calling macrun exe>
Dim sPPTOut As String 'PPT basename (excludes .ppt extension)
sPPTOut = MDEPDirStr + sID + ".ppt" '
Dim p As New System.Diagnostics.Process
p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
'p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
<end asp.net code calling macrun exe>

<begin macrun (macro running exe)>
Imports System.io
Module StartupModule
Public Sub Main(ByVal CmdArgs() As String)
Dim sArg As String
sArg = CmdArgs(0).ToUpper

Dim oPP As PowerPoint.ApplicationClass
Dim oPresSet As PowerPoint.Presentations
Dim oPres As PowerPoint.PresentationClass

'Start PowerPoint and open the presentation.
oPP = CreateObject("PowerPoint.Application")
oPP.Visible = True
oPresSet = oPP.Presentations

oPres = oPresSet.Open(Application.StartupPath & "\" & sArg & ".ppt",
, , True)

'Run the macros.
oPP.Run("'" & Application.StartupPath & "\" & sArg & ".ppt'!mymac")
oPP.ActivePresentation.SaveCopyAs(Application.StartupPath & "\out-"
& sArg & ".ppt")

'Clean-up: Close the presentation and quit PowerPoint.
oPres.Close()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oPres)
oPres = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComObject(oPresSet)
oPresSet = Nothing
oPP.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oPP)
oPP = Nothing

GC.Collect()
End Sub
End Module
<end macrun (macro running exe)>

Thanks.


Steven Cheng said:
Thanks for your response Snicks,

So your dev box is WINXP, by default the ASP.NET running process idenitity
should be machine/ASPNET account... You can check the "aspnet_wp.exe"
process's account in task manager when running asp.net application to
confirm this....

Also, the filemon tool is not a build-in tool, you need to download it from
sysinternals website, it's a freeware:

#Filemon for Windows
http://www.sysinternals.com/utilities/filemon.html

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| Thread-Topic: JIT Debugging error when trying to exec app external to
ASP.NE
| thread-index: AcYcMQ0oqtE3o4bGSFmKIjWCBejojA==
| X-WBNR-Posting-Host: 66.160.85.199
| From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: JIT Debugging error when trying to exec app external to
ASP.NE
| Date: Wed, 18 Jan 2006 05:14:02 -0800
| Lines: 120
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:371708
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I'm running the dev env on my local machine - XP. I tried to run
filemon.exe
| from start\run but it was not found. I checked the World Wide Web
Publishing
| service and it is running C:\WINDOWS\system32\inetsrv\inetinfo.exe.
| inetinfo.exe has a file version of 5.1.2600.2180 and same product
version.
| The ASPNET user is a member of the users group. ASP.NET State Service
was
| actually not started but it was setup to log on as NT
| AUTHORITY\NetworkService. I started the ASP.NET State Service, tried
| reruning the app and received the same error.
|
| Thanks Steven
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Snicks,
| >
| > Welcome to ASPNET newsgroup.
| > From your description, you're using the System.Diagnostics.Process
class to
| > execute an external custom program(exe file) fomr your asp.net web
| > application. However, you're getting Access Denied error when executing
| > that app , yes?
| >
| > Based on your description on the custom program "macrun.exe" which will
| > create PPT file and running macro, I think it is likely the running
process
| > idenitity dosn't have sufficient permission to create/modify certain
folder
| > since it has file accessing operations in it...... When you use the
.net's
| > System.Diagnostics.Process class to executing a new process, it will
| > inherit the security context(process idenitity) from the parent process
| > (the ASP.NET worker process), so running that external app from asp.net
app
| > is different from command line(which running under the current logon
| > user....). What's the server version and IIS version you're
developing
| > with and what's the current process identity of your asp.net app( have
you
| > used impersonate or not...)...
| >
| > BTW, you can consider using Filemon tool to monitor the file accessing
on
| > the server when your asp.net app try executing that custom program...
| > Filemon can capture the file accessing failure and we can have a look
at
| > the path and security identity that cause the problem...
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| > --------------------
| > | Thread-Topic: JIT Debugging error when trying to exec app external to
| > ASP.NET
| > | thread-index: AcYb7UwHqXxLD2gjT0SDeLkAA9SJ5g==
| > | X-WBNR-Posting-Host: 66.160.85.199
| > | From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| > | Subject: JIT Debugging error when trying to exec app external to
ASP.NET
| > | Date: Tue, 17 Jan 2006 21:09:02 -0800
| > | Lines: 40
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:371623
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I'm trying to exec a program external to my ASP.NET app using the
| > following
| > | code. The external app is a VB.NET application.
| > |
| > | Dim sPPTOut As String
| > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | Dim p As New System.Diagnostics.Process
| > |
| > | 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
| > | p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
| > | 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
| > |
| > | The problem is that the two commented lines generate:
| > |
| > | JIT Debugging failed with the following error: Access is denied.
| > |
| > | errors. The uncommented exec of CALC.EXE works w/o issue. Running
| > | macrun.exe from a command prompt works w/o issue.
| > |
| > | Big picture is that I'm creating a PowerPoint file on the server and
| > after
| > | saving it to the server file system I need to run a macro embedded in
the
| > | PPT. macrun.exe opens the PPT and runs the macro.
| > |
| > | I've tried other methods of execing the program with similar results:
| > |
| > | Shell("C:\WINDOWS\SYSTEM32\CALC.EXE")
| > | 'Shell(MDEPDirStr & "macrun.exe", sPPTOut)
| > | 'Shell(MDEPDirStr & "macrun.exe " & sPPTOut)
| > |
| > | Dim sPPTOut As String
| > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | Dim listFiles As System.Diagnostics.Process
| > | listFiles = System.Diagnostics.Process.Start(MDEPDirStr &
| > | "macrun.exe", sPPTOut)
| > | listFiles.WaitForExit(2000)
| > | If listFiles.HasExited Then
| > | 'Dim output As String = myOutput.ReadToEnd
| > | 'Debug.WriteLine(output)
| > | End If
| > |
| > |
| > |
| >
| >
|
 
S

Steven Cheng[MSFT]

Thanks for your response Snicks,

Yes, filemon will logging all the file accessing operations on the machine
which may result huge amount of data if we don't capture it carefully...
You can use hot keys to make the stop and capture quickly...

For the problem, I think we can try creating a simplified application to
reproduce the problem. Since you have some file IO operation in your
external exe app, would you try creating a simple .net exe which write a
txt file to the certain file path to see whether it can also reproduce the
problem?

In addition, you can also temporarly change the ASP.NET's worker process
identity to LOCAL SYSTEM for test, just locate the machine.config file
under the .net framework's install dir:


%windir%\Microsoft.NET\Framework\v1.1.4322\CONFIG\machine.config


find the <processModel> element, and change the userName from "Machine" to
"SYSTEM"

also, you need to restart IIS to have it take effect

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: JIT Debugging error when trying to exec app external to
ASP.NE
| thread-index: AcYdVbhAKK8mA8gyS7mTiPs6CBReYg==
| X-WBNR-Posting-Host: 66.160.85.199
| From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: JIT Debugging error when trying to exec app external to
ASP.NE
| Date: Thu, 19 Jan 2006 16:09:02 -0800
| Lines: 259
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:372266
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I checked aspnet_wp.exe in the task manager and the user name is ASPNET.
| I've downloaded filemon and it produces lots of data :) Outside of
looking
| at the filemon output do you have any suggestions based upon the
information
| I've provided so far?
|
| If the filemon log is required what should I send and how. Recording
just a
| few seconds generated a 1.6MB file.
|
| Below is the code involved. Maybe you could just compile a VB.NET app
with
| the macrun exe code and plug the asp.net code into an existing web site.
|
| Thanks Steven.
|
| <begin asp.net code calling macrun exe>
| Dim sPPTOut As String 'PPT basename (excludes .ppt extension)
| sPPTOut = MDEPDirStr + sID + ".ppt" '
| Dim p As New System.Diagnostics.Process
| p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
| 'p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
| 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
| <end asp.net code calling macrun exe>
|
| <begin macrun (macro running exe)>
| Imports System.io
| Module StartupModule
| Public Sub Main(ByVal CmdArgs() As String)
| Dim sArg As String
| sArg = CmdArgs(0).ToUpper
|
| Dim oPP As PowerPoint.ApplicationClass
| Dim oPresSet As PowerPoint.Presentations
| Dim oPres As PowerPoint.PresentationClass
|
| 'Start PowerPoint and open the presentation.
| oPP = CreateObject("PowerPoint.Application")
| oPP.Visible = True
| oPresSet = oPP.Presentations
|
| oPres = oPresSet.Open(Application.StartupPath & "\" & sArg &
".ppt",
| , , True)
|
| 'Run the macros.
| oPP.Run("'" & Application.StartupPath & "\" & sArg &
".ppt'!mymac")
| oPP.ActivePresentation.SaveCopyAs(Application.StartupPath &
"\out-"
| & sArg & ".ppt")
|
| 'Clean-up: Close the presentation and quit PowerPoint.
| oPres.Close()
| System.Runtime.InteropServices.Marshal.ReleaseComObject(oPres)
| oPres = Nothing
| System.Runtime.InteropServices.Marshal.ReleaseComObject(oPresSet)
| oPresSet = Nothing
| oPP.Quit()
| System.Runtime.InteropServices.Marshal.ReleaseComObject(oPP)
| oPP = Nothing
|
| GC.Collect()
| End Sub
| End Module
| <end macrun (macro running exe)>
|
| Thanks.
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Thanks for your response Snicks,
| >
| > So your dev box is WINXP, by default the ASP.NET running process
idenitity
| > should be machine/ASPNET account... You can check the "aspnet_wp.exe"
| > process's account in task manager when running asp.net application to
| > confirm this....
| >
| > Also, the filemon tool is not a build-in tool, you need to download it
from
| > sysinternals website, it's a freeware:
| >
| > #Filemon for Windows
| > http://www.sysinternals.com/utilities/filemon.html
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: JIT Debugging error when trying to exec app external to
| > ASP.NE
| > | thread-index: AcYcMQ0oqtE3o4bGSFmKIjWCBejojA==
| > | X-WBNR-Posting-Host: 66.160.85.199
| > | From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: RE: JIT Debugging error when trying to exec app external to
| > ASP.NE
| > | Date: Wed, 18 Jan 2006 05:14:02 -0800
| > | Lines: 120
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:371708
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I'm running the dev env on my local machine - XP. I tried to run
| > filemon.exe
| > | from start\run but it was not found. I checked the World Wide Web
| > Publishing
| > | service and it is running C:\WINDOWS\system32\inetsrv\inetinfo.exe.
| > | inetinfo.exe has a file version of 5.1.2600.2180 and same product
| > version.
| > | The ASPNET user is a member of the users group. ASP.NET State
Service
| > was
| > | actually not started but it was setup to log on as NT
| > | AUTHORITY\NetworkService. I started the ASP.NET State Service, tried
| > | reruning the app and received the same error.
| > |
| > | Thanks Steven
| > |
| > | "Steven Cheng[MSFT]" wrote:
| > |
| > | > Hi Snicks,
| > | >
| > | > Welcome to ASPNET newsgroup.
| > | > From your description, you're using the System.Diagnostics.Process
| > class to
| > | > execute an external custom program(exe file) fomr your asp.net web
| > | > application. However, you're getting Access Denied error when
executing
| > | > that app , yes?
| > | >
| > | > Based on your description on the custom program "macrun.exe" which
will
| > | > create PPT file and running macro, I think it is likely the running
| > process
| > | > idenitity dosn't have sufficient permission to create/modify
certain
| > folder
| > | > since it has file accessing operations in it...... When you use
the
| > .net's
| > | > System.Diagnostics.Process class to executing a new process, it
will
| > | > inherit the security context(process idenitity) from the parent
process
| > | > (the ASP.NET worker process), so running that external app from
asp.net
| > app
| > | > is different from command line(which running under the current
logon
| > | > user....). What's the server version and IIS version you're
| > developing
| > | > with and what's the current process identity of your asp.net app(
have
| > you
| > | > used impersonate or not...)...
| > | >
| > | > BTW, you can consider using Filemon tool to monitor the file
accessing
| > on
| > | > the server when your asp.net app try executing that custom
program...
| > | > Filemon can capture the file accessing failure and we can have a
look
| > at
| > | > the path and security identity that cause the problem...
| > | >
| > | > Thanks,
| > | >
| > | > Steven Cheng
| > | > Microsoft Online Support
| > | >
| > | > Get Secure! www.microsoft.com/security
| > | > (This posting is provided "AS IS", with no warranties, and confers
no
| > | > rights.)
| > | >
| > | >
| > | >
| > | > --------------------
| > | > | Thread-Topic: JIT Debugging error when trying to exec app
external to
| > | > ASP.NET
| > | > | thread-index: AcYb7UwHqXxLD2gjT0SDeLkAA9SJ5g==
| > | > | X-WBNR-Posting-Host: 66.160.85.199
| > | > | From: =?Utf-8?B?c25pY2tz?= <[email protected]>
| > | > | Subject: JIT Debugging error when trying to exec app external to
| > ASP.NET
| > | > | Date: Tue, 17 Jan 2006 21:09:02 -0800
| > | > | Lines: 40
| > | > | Message-ID: <[email protected]>
| > | > | MIME-Version: 1.0
| > | > | Content-Type: text/plain;
| > | > | charset="Utf-8"
| > | > | Content-Transfer-Encoding: 7bit
| > | > | X-Newsreader: Microsoft CDO for Windows 2000
| > | > | Content-Class: urn:content-classes:message
| > | > | Importance: normal
| > | > | Priority: normal
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | > | Path:
| > TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | > | Xref: TK2MSFTNGXA02.phx.gbl
| > | > microsoft.public.dotnet.framework.aspnet:371623
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > | > |
| > | > | I'm trying to exec a program external to my ASP.NET app using the
| > | > following
| > | > | code. The external app is a VB.NET application.
| > | > |
| > | > | Dim sPPTOut As String
| > | > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | > | Dim p As New System.Diagnostics.Process
| > | > |
| > | > | 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut)
| > | > | p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE")
| > | > | 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
| > | > |
| > | > | The problem is that the two commented lines generate:
| > | > |
| > | > | JIT Debugging failed with the following error: Access is denied.
| > | > |
| > | > | errors. The uncommented exec of CALC.EXE works w/o issue.
Running
| > | > | macrun.exe from a command prompt works w/o issue.
| > | > |
| > | > | Big picture is that I'm creating a PowerPoint file on the server
and
| > | > after
| > | > | saving it to the server file system I need to run a macro
embedded in
| > the
| > | > | PPT. macrun.exe opens the PPT and runs the macro.
| > | > |
| > | > | I've tried other methods of execing the program with similar
results:
| > | > |
| > | > | Shell("C:\WINDOWS\SYSTEM32\CALC.EXE")
| > | > | 'Shell(MDEPDirStr & "macrun.exe", sPPTOut)
| > | > | 'Shell(MDEPDirStr & "macrun.exe " & sPPTOut)
| > | > |
| > | > | Dim sPPTOut As String
| > | > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | > | Dim listFiles As System.Diagnostics.Process
| > | > | listFiles = System.Diagnostics.Process.Start(MDEPDirStr &
| > | > | "macrun.exe", sPPTOut)
| > | > | listFiles.WaitForExit(2000)
| > | > | If listFiles.HasExited Then
| > | > | 'Dim output As String = myOutput.ReadToEnd
| > | > | 'Debug.WriteLine(output)
| > | > | End If
| > | > |
| > | > |
| > | > |
| > | >
| > | >
| > |
| >
| >
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top