473,721 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Diagnost ics.Process

'p.Start(MDEPDi rStr & "macrun.exe ", sPPTOut)
p.Start("C:\WIN DOWS\SYSTEM32\C ALC.EXE")
'p.Start("C:\WI NDOWS\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:\WINDO WS\SYSTEM32\CAL C.EXE")
'Shell(MDEPDirS tr & "macrun.exe ", sPPTOut)
'Shell(MDEPDirS tr & "macrun.exe " & sPPTOut)

Dim sPPTOut As String
sPPTOut = MDEPDirStr + sID + ".ppt"
Dim listFiles As System.Diagnost ics.Process
listFiles = System.Diagnost ics.Process.Sta rt(MDEPDirStr &
"macrun.exe ", sPPTOut)
listFiles.WaitF orExit(2000)
If listFiles.HasEx ited Then
'Dim output As String = myOutput.ReadTo End
'Debug.WriteLin e(output)
End If
Jan 18 '06 #1
5 3633
Hi Snicks,

Welcome to ASPNET newsgroup.
From your description, you're using the System.Diagnost ics.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.Diagnost ics.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: AcYb7UwHqXxLD2g jT0SDeLkAA9SJ5g ==
| 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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3716 23
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.Diagnost ics.Process
|
| 'p.Start(MDEPDi rStr & "macrun.exe ", sPPTOut)
| p.Start("C:\WIN DOWS\SYSTEM32\C ALC.EXE")
| 'p.Start("C:\WI NDOWS\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:\WINDO WS\SYSTEM32\CAL C.EXE")
| 'Shell(MDEPDirS tr & "macrun.exe ", sPPTOut)
| 'Shell(MDEPDirS tr & "macrun.exe " & sPPTOut)
|
| Dim sPPTOut As String
| sPPTOut = MDEPDirStr + sID + ".ppt"
| Dim listFiles As System.Diagnost ics.Process
| listFiles = System.Diagnost ics.Process.Sta rt(MDEPDirStr &
| "macrun.exe ", sPPTOut)
| listFiles.WaitF orExit(2000)
| If listFiles.HasEx ited Then
| 'Dim output As String = myOutput.ReadTo End
| 'Debug.WriteLin e(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\syst em32\inetsrv\in etinfo.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\Netwo rkService. 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.Diagnost ics.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.Diagnost ics.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: AcYb7UwHqXxLD2g jT0SDeLkAA9SJ5g ==
| 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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3716 23
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.Diagnost ics.Process
|
| 'p.Start(MDEPDi rStr & "macrun.exe ", sPPTOut)
| p.Start("C:\WIN DOWS\SYSTEM32\C ALC.EXE")
| 'p.Start("C:\WI NDOWS\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:\WINDO WS\SYSTEM32\CAL C.EXE")
| 'Shell(MDEPDirS tr & "macrun.exe ", sPPTOut)
| 'Shell(MDEPDirS tr & "macrun.exe " & sPPTOut)
|
| Dim sPPTOut As String
| sPPTOut = MDEPDirStr + sID + ".ppt"
| Dim listFiles As System.Diagnost ics.Process
| listFiles = System.Diagnost ics.Process.Sta rt(MDEPDirStr &
| "macrun.exe ", sPPTOut)
| listFiles.WaitF orExit(2000)
| If listFiles.HasEx ited Then
| 'Dim output As String = myOutput.ReadTo End
| 'Debug.WriteLin e(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: AcYcMQ0oqtE3o4b GSFmKIjWCBejojA ==
| X-WBNR-Posting-Host: 66.160.85.199
| From: =?Utf-8?B?c25pY2tz?= <sn****@nospam. nospam>
| References: <C7************ *************** *******@microso ft.com>
<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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3717 08
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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\syst em32\inetsrv\in etinfo.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\Netwo rkService. 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.Diagnost ics.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.Diagnost ics.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: AcYb7UwHqXxLD2g jT0SDeLkAA9SJ5g ==
| > | 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************ *************** *******@microso ft.com>
| > | 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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3716 23
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.Diagnost ics.Process
| > |
| > | 'p.Start(MDEPDi rStr & "macrun.exe ", sPPTOut)
| > | p.Start("C:\WIN DOWS\SYSTEM32\C ALC.EXE")
| > | 'p.Start("C:\WI NDOWS\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:\WINDO WS\SYSTEM32\CAL C.EXE")
| > | 'Shell(MDEPDirS tr & "macrun.exe ", sPPTOut)
| > | 'Shell(MDEPDirS tr & "macrun.exe " & sPPTOut)
| > |
| > | Dim sPPTOut As String
| > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | Dim listFiles As System.Diagnost ics.Process
| > | listFiles = System.Diagnost ics.Process.Sta rt(MDEPDirStr &
| > | "macrun.exe ", sPPTOut)
| > | listFiles.WaitF orExit(2000)
| > | If listFiles.HasEx ited Then
| > | 'Dim output As String = myOutput.ReadTo End
| > | 'Debug.WriteLin e(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.Diagnost ics.Process
p.Start(MDEPDir Str & "macrun.exe ", sPPTOut)
'p.Start("C:\WI NDOWS\SYSTEM32\ CALC.EXE")
'p.Start("C:\WI NDOWS\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).ToUp per

Dim oPP As PowerPoint.Appl icationClass
Dim oPresSet As PowerPoint.Pres entations
Dim oPres As PowerPoint.Pres entationClass

'Start PowerPoint and open the presentation.
oPP = CreateObject("P owerPoint.Appli cation")
oPP.Visible = True
oPresSet = oPP.Presentatio ns

oPres = oPresSet.Open(A pplication.Star tupPath & "\" & sArg & ".ppt",
, , True)

'Run the macros.
oPP.Run("'" & Application.Sta rtupPath & "\" & sArg & ".ppt'!myma c")
oPP.ActivePrese ntation.SaveCop yAs(Application .StartupPath & "\out-"
& sArg & ".ppt")

'Clean-up: Close the presentation and quit PowerPoint.
oPres.Close()
System.Runtime. InteropServices .Marshal.Releas eComObject(oPre s)
oPres = Nothing
System.Runtime. InteropServices .Marshal.Releas eComObject(oPre sSet)
oPresSet = Nothing
oPP.Quit()
System.Runtime. InteropServices .Marshal.Releas eComObject(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: AcYcMQ0oqtE3o4b GSFmKIjWCBejojA ==
| X-WBNR-Posting-Host: 66.160.85.199
| From: =?Utf-8?B?c25pY2tz?= <sn****@nospam. nospam>
| References: <C7************ *************** *******@microso ft.com>
<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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3717 08
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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\syst em32\inetsrv\in etinfo.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\Netwo rkService. 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.Diagnost ics.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.Diagnost ics.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: AcYb7UwHqXxLD2g jT0SDeLkAA9SJ5g ==
| > | 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************ *************** *******@microso ft.com>
| > | 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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3716 23
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.Diagnost ics.Process
| > |
| > | 'p.Start(MDEPDi rStr & "macrun.exe ", sPPTOut)
| > | p.Start("C:\WIN DOWS\SYSTEM32\C ALC.EXE")
| > | 'p.Start("C:\WI NDOWS\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:\WINDO WS\SYSTEM32\CAL C.EXE")
| > | 'Shell(MDEPDirS tr & "macrun.exe ", sPPTOut)
| > | 'Shell(MDEPDirS tr & "macrun.exe " & sPPTOut)
| > |
| > | Dim sPPTOut As String
| > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | Dim listFiles As System.Diagnost ics.Process
| > | listFiles = System.Diagnost ics.Process.Sta rt(MDEPDirStr &
| > | "macrun.exe ", sPPTOut)
| > | listFiles.WaitF orExit(2000)
| > | If listFiles.HasEx ited Then
| > | 'Dim output As String = myOutput.ReadTo End
| > | 'Debug.WriteLin e(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%\Micros oft.NET\Framewo rk\v1.1.4322\CO NFIG\machine.co nfig
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: AcYdVbhAKK8mA8g yS7mTiPs6CBReYg ==
| X-WBNR-Posting-Host: 66.160.85.199
| From: =?Utf-8?B?c25pY2tz?= <sn****@nospam. nospam>
| References: <C7************ *************** *******@microso ft.com>
<Oz************ *@TK2MSFTNGXA02 .phx.gbl>
<82************ *************** *******@microso ft.com>
<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************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGXA03.phx .gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3722 66
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.Diagnost ics.Process
| p.Start(MDEPDir Str & "macrun.exe ", sPPTOut)
| 'p.Start("C:\WI NDOWS\SYSTEM32\ CALC.EXE")
| 'p.Start("C:\WI NDOWS\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).ToUp per
|
| Dim oPP As PowerPoint.Appl icationClass
| Dim oPresSet As PowerPoint.Pres entations
| Dim oPres As PowerPoint.Pres entationClass
|
| 'Start PowerPoint and open the presentation.
| oPP = CreateObject("P owerPoint.Appli cation")
| oPP.Visible = True
| oPresSet = oPP.Presentatio ns
|
| oPres = oPresSet.Open(A pplication.Star tupPath & "\" & sArg &
".ppt",
| , , True)
|
| 'Run the macros.
| oPP.Run("'" & Application.Sta rtupPath & "\" & sArg &
".ppt'!myma c")
| oPP.ActivePrese ntation.SaveCop yAs(Application .StartupPath &
"\out-"
| & sArg & ".ppt")
|
| 'Clean-up: Close the presentation and quit PowerPoint.
| oPres.Close()
| System.Runtime. InteropServices .Marshal.Releas eComObject(oPre s)
| oPres = Nothing
| System.Runtime. InteropServices .Marshal.Releas eComObject(oPre sSet)
| oPresSet = Nothing
| oPP.Quit()
| System.Runtime. InteropServices .Marshal.Releas eComObject(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: AcYcMQ0oqtE3o4b GSFmKIjWCBejojA ==
| > | X-WBNR-Posting-Host: 66.160.85.199
| > | From: =?Utf-8?B?c25pY2tz?= <sn****@nospam. nospam>
| > | References: <C7************ *************** *******@microso ft.com>
| > <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************ *************** *******@microso ft.com>
| > | 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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3717 08
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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\syst em32\inetsrv\in etinfo.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\Netwo rkService. 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.Diagnost ics.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.Diagnost ics.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: AcYb7UwHqXxLD2g jT0SDeLkAA9SJ5g ==
| > | > | 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************ *************** *******@microso ft.com>
| > | > | 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.publi c.dotnet.framew ork.aspnet
| > | > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | > | Path:
| > TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA01.phx.gbl!T K2MSFTNGXA03.ph x.gbl
| > | > | Xref: TK2MSFTNGXA02.p hx.gbl
| > | > microsoft.publi c.dotnet.framew ork.aspnet:3716 23
| > | > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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.Diagnost ics.Process
| > | > |
| > | > | 'p.Start(MDEPDi rStr & "macrun.exe ", sPPTOut)
| > | > | p.Start("C:\WIN DOWS\SYSTEM32\C ALC.EXE")
| > | > | 'p.Start("C:\WI NDOWS\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:\WINDO WS\SYSTEM32\CAL C.EXE")
| > | > | 'Shell(MDEPDirS tr & "macrun.exe ", sPPTOut)
| > | > | 'Shell(MDEPDirS tr & "macrun.exe " & sPPTOut)
| > | > |
| > | > | Dim sPPTOut As String
| > | > | sPPTOut = MDEPDirStr + sID + ".ppt"
| > | > | Dim listFiles As System.Diagnost ics.Process
| > | > | listFiles = System.Diagnost ics.Process.Sta rt(MDEPDirStr &
| > | > | "macrun.exe ", sPPTOut)
| > | > | listFiles.WaitF orExit(2000)
| > | > | If listFiles.HasEx ited Then
| > | > | 'Dim output As String = myOutput.ReadTo End
| > | > | 'Debug.WriteLin e(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
8414
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 file rc4.obj(rc4.c),it is creating the .dll file without any error. Command : ILINK32 rc4.obj 2.But,when we are trying to create .dll file with two .obj files with following errors.
6
4775
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, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
2
2122
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() exec scriptLines However, if I raise an exception in my main code, in a function that is called from the external script, the stack trace just has:
3
1882
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 executed) but the server returns: CGI Error, CGI-application misbehaved.....
16
4213
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 project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
1
2047
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. I am using the final VS2005Pro, running on WinXP MCE 2005 on a Laptop. Any Suggestions?
3
1721
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. If someone could tell me what I'm missing that would be great. 1. Create an external class and call it Test.dll. 2. Create a test Asp.net app called App.sln. 3. For App.sln I set a reference to Test.dll. 4. Compile App.sln and run it. The web...
6
2204
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. If someone could tell me what I'm missing that would be great. 1. Create an external class and call it Test.dll. 2. Create a test Asp.net app called App.sln. 3. For App.sln I set a reference to Test.dll. 4. Compile App.sln and run it. The web...
0
2444
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 nowhere as debugging was working fine one day and then this error the next. I've read plenty of posts relating to this error but they all seem outdated and they mostly seem to point to Application.EnableVisualStyles() which i do not use. Also note...
0
8840
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9367
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9131
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6669
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.