473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
Jan 18 '06 #1
5 3592
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?= <sn****@nospam.nospam>
| 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: <C7**********************************@microsoft.co m>
| 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!TK2MSF TNGXA03.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
|
|
|

Jan 18 '06 #2
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?= <sn****@nospam.nospam>
| 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: <C7**********************************@microsoft.co m>
| 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!TK2MSF TNGXA03.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
|
|
|

Jan 18 '06 #3
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?= <sn****@nospam.nospam>
| References: <C7**********************************@microsoft.co m>
<Oz*************@TK2MSFTNGXA02.phx.gbl>
| 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: <82**********************************@microsoft.co m>
| 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?= <sn****@nospam.nospam>
| > | 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: <C7**********************************@microsoft.co m>
| > | 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!TK2MSF TNGXA03.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
| > |
| > |
| > |
| >
| >
|

Jan 19 '06 #4
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.Star tupPath & "\out-"
& sArg & ".ppt")

'Clean-up: Close the presentation and quit PowerPoint.
oPres.Close()
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oPres)
oPres = Nothing
System.Runtime.InteropServices.Marshal.ReleaseComO bject(oPresSet)
oPresSet = Nothing
oPP.Quit()
System.Runtime.InteropServices.Marshal.ReleaseComO bject(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?= <sn****@nospam.nospam>
| References: <C7**********************************@microsoft.co m>
<Oz*************@TK2MSFTNGXA02.phx.gbl>
| 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: <82**********************************@microsoft.co m>
| 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?= <sn****@nospam.nospam>
| > | 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: <C7**********************************@microsoft.co m>
| > | 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!TK2MSF TNGXA03.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
| > |
| > |
| > |
| >
| >
|

Jan 20 '06 #5
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?= <sn****@nospam.nospam>
| References: <C7**********************************@microsoft.co m>
<Oz*************@TK2MSFTNGXA02.phx.gbl>
<82**********************************@microsoft.co m>
<JG*************@TK2MSFTNGXA02.phx.gbl>
| 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: <90**********************************@microsoft.co m>
| 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!TK2MSFT NGXA03.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.Star tupPath &
"\out-"
| & sArg & ".ppt")
|
| 'Clean-up: Close the presentation and quit PowerPoint.
| oPres.Close()
| System.Runtime.InteropServices.Marshal.ReleaseComO bject(oPres)
| oPres = Nothing
| System.Runtime.InteropServices.Marshal.ReleaseComO bject(oPresSet)
| oPresSet = Nothing
| oPP.Quit()
| System.Runtime.InteropServices.Marshal.ReleaseComO bject(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?= <sn****@nospam.nospam>
| > | References: <C7**********************************@microsoft.co m>
| > <Oz*************@TK2MSFTNGXA02.phx.gbl>
| > | 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: <82**********************************@microsoft.co m>
| > | 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?= <sn****@nospam.nospam>
| > | > | 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: <C7**********************************@microsoft.co m>
| > | > | 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!TK2MSF TNGXA03.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
| > | > |
| > | > |
| > | > |
| > | >
| > | >
| > |
| >
| >
|

Jan 23 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
6
by: Hug | last post by:
Hello everybody I try to use gdb to debug my program but i have this message : --------------------------- GNU gdb 5.3 Copyright 2002 Free Software Foundation, Inc. GDB is free software,...
2
by: Hugh Macdonald | last post by:
I'm writing a tool at the moment that reads in an external file (which can use any Python syntax) At the moment, I'm reading the file in using: scriptLines = open(baseRippleScript).read()...
3
by: Alexander | last post by:
Hi there, i am trying to run php(4.3.4) on iis6 (W2k3 Server). All works perfect except running external programs. The command system (or exec) starts and works (tried it, and the command is...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
1
by: DEWright_CA | last post by:
I have built a pretty basic site and now when I try t debug it I get a error that says; {0}: Build (web): "The type initializer for 'System.Web.Compilation.CompilationLock' threw an exceptoin. ...
3
by: Brian Bischof | last post by:
I'm having troubles getting the debugging process to work consistenly for external classes. I got it to work once and then I turned it off. But now I can't get re-enabled. Here is what I'm doing....
6
by: Brian Bischof | last post by:
I'm having troubles getting the debugging process to work consistenly for external classes. I got it to work once and then I turned it off. But now I can't get re-enabled. Here is what I'm doing....
0
by: THEDuke141 | last post by:
Hi guys, I've lately been plagued with a SEHException while trying to debug VB.Net applications. I'm not exactly sure when the problem started to appear but it literally just appeared out of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.