VS 2005 post Build event problem

S

Steve B.

Hi,

I'm working on Windows 2003 Server SP2 X64 edition to create SharePoint
extentions.

After each rebuild, I have to recycle app pool that use the extention I've
build, that's why I wanted to add the following line in post build events :

"%windir%\system32\cscript.exe" "%windir%\system32\iisapp.vbs" /a "My SP app
pool" /r

This command line is working perfectly when I open it in a cmd window, but
in VS, I get an error (in the output pane):



"Microsoft (R) Windows Script Host Version 5.6

Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Input Error: Can not find script file "c:\windows\system32\iisapp.vbs".



What is wrong ?



Thanks,

Steve
 
A

Andrew McDonald

Steve B. said:
Hi,

I'm working on Windows 2003 Server SP2 X64 edition to create SharePoint
extentions.

After each rebuild, I have to recycle app pool that use the extention I've
build, that's why I wanted to add the following line in post build events
:

"%windir%\system32\cscript.exe" "%windir%\system32\iisapp.vbs" /a "My SP
app pool" /r

This command line is working perfectly when I open it in a cmd window, but
in VS, I get an error (in the output pane):

"Microsoft (R) Windows Script Host Version 5.6

Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

Input Error: Can not find script file "c:\windows\system32\iisapp.vbs".

What is wrong ?

I've no idea about the Windows Script Host, but perhaps it's interpreting
the quote marks as part of the filename. What happens if you remove them
from %windir%\system32\iisapp.vbs?
 
S

Steve B.

I tried but that does not change...

Steve


Andrew McDonald said:
I've no idea about the Windows Script Host, but perhaps it's interpreting
the quote marks as part of the filename. What happens if you remove them
from %windir%\system32\iisapp.vbs?
 
A

Ashot Geodakov

Perhaps Visual Studio can not translate the environment variables that you
specify between %%s.

Try instead just hardcode these paths like:
C:\Windows\system32\cscript.exe C:\Windows\System32\system32\iisapp.vbs /a
"My SP app pool" /r
 
S

Steve B.

As you can see in my first post, the error message says that the file
c:\windows\system32\iisapp.vbs cannot be found.
So I suppose the env variable are correctly expanded.

I also tried with the full hardcoded path (in case my hypothesis was not
correct), but I got the same error.

Thanks,
Steve
 
A

Ashot Geodakov

Sorry I misread your first post.

As an option, could you create a .BAT file with that command and call that
..BAT from VS?
 
S

Steve B.

I also tried, with the same result...


Ashot Geodakov said:
Sorry I misread your first post.

As an option, could you create a .BAT file with that command and call that
.BAT from VS?
 

Ask a Question

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

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

Ask a Question

Top