473,320 Members | 1,854 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,320 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 3586
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.