473,703 Members | 2,328 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 3630
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
8412
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
4771
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
2121
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
1880
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
4209
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
2046
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
1719
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
2200
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
8669
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
9251
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...
0
9122
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9017
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
8963
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...
1
6588
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
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3125
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.