.WSC无法识别代码更改

时间:2020-12-19 09:05:55

I've run into this problem before and the solution has usually been to restart IIS. Basically I've made a number of changes to a .wsc file on our server. But when it runs it doesn't run the new code changes I made. I've verified this with event logging at the beginning of the file and it doesn't show up.

我以前遇到过这个问题,解决方案通常是重启IIS。基本上我对服务器上的.wsc文件进行了一些更改。但是当它运行时,它不会运行我所做的新代码更改。我已经通过文件开头的事件记录验证了这一点并且没有显示出来。

My problem is that obviously restarting IIS on our production server is something I'm loathe to do, but we need this running today. I've tried re-registering the file but to no avail.

我的问题是,显然在我们的生产服务器上重新启动IIS是我不愿意做的事情,但我们今天需要运行它。我已经尝试重新注册该文件,但无济于事。

The server is a 32-bit Server 2008 OS. And the code is running, it still generates the file it is supposed to, but like I said, it's not using the latest changes.

该服务器是32位Server 2008操作系统。并且代码正在运行,它仍然会生成它应该的文件,但就像我说的那样,它没有使用最新的更改。

Any other info I can provide, please leave a comment and I'll edit.

我可以提供的任何其他信息,请发表评论,我将编辑。

Thank you, Jeff

谢谢杰夫

Edit: Oisin, thanks for the reply and yes I know I hate VBScript, and anything related to it including these Window Script Components. I've expressed such feelings to my manager, but it's a dirty job and someone has to do it!

编辑:Oisin,感谢回复,是的,我知道我讨厌VBScript,以及任何与之相关的内容,包括这些Window Script Components。我向经理表达了这样的感受,但这是一份肮脏的工作,有人必须这样做!

Yes it's using a Server.CreateObject to call the component.

是的,它使用Server.CreateObject来调用组件。

ANSWER: I've since realized my mistake. I was only 'registering' it over and over, when I should have first 'unregester'ed it the 'register'ed it. Man I feel stupid, but haste makes waste as they say.

答案:我已经意识到自己的错误了。我只是一次又一次地“注册”它,当我第一次'没有注册'它'注册'它。男人我觉得自己很蠢,但是匆匆如他们所说的那样浪费。

Thanks for the response and link!

感谢您的回复和链接!

1 个解决方案

#1


Eek, you mean WSC as in a Windows Script Component? I haven't written one of them since 2000.

Eek,你的意思是WSC和Windows脚本组件一样?自2000年以来我没有写过其中一篇。

Are you loading it using CreateObject (e.g. it's registered as a COM object via regsvr32), or are you using a file-based moniker to load it? (not registered).

您是使用CreateObject加载它(例如,它是通过regsvr32注册为COM对象),还是使用基于文件的名字对象来加载它? (未注册)。

If it's registered, it probably is cached until app restart. If you switched to a file based moniker, e.g. like: Set o = GetObject("script:c:\path\obj.wsc"), you might get away with runtime changes to the .wsc file.

如果它已注册,它可能会缓存,直到应用程序重新启动。如果您切换到基于文件的名字对象,例如喜欢:设置o = GetObject(“script:c:\ path \ obj.wsc”),你可能会对.wsc文件的运行时更改失败。

(man, how did I even remember this)

(伙计,我怎么记得这个)

more info here - quick before it's archived! :D http://www.microsoft.com/technet/scriptcenter/resources/scriptshop/default.mspx

更多信息 - 快速归档之前! :D http://www.microsoft.com/technet/scriptcenter/resources/scriptshop/default.mspx

-Oisin

#1


Eek, you mean WSC as in a Windows Script Component? I haven't written one of them since 2000.

Eek,你的意思是WSC和Windows脚本组件一样?自2000年以来我没有写过其中一篇。

Are you loading it using CreateObject (e.g. it's registered as a COM object via regsvr32), or are you using a file-based moniker to load it? (not registered).

您是使用CreateObject加载它(例如,它是通过regsvr32注册为COM对象),还是使用基于文件的名字对象来加载它? (未注册)。

If it's registered, it probably is cached until app restart. If you switched to a file based moniker, e.g. like: Set o = GetObject("script:c:\path\obj.wsc"), you might get away with runtime changes to the .wsc file.

如果它已注册,它可能会缓存,直到应用程序重新启动。如果您切换到基于文件的名字对象,例如喜欢:设置o = GetObject(“script:c:\ path \ obj.wsc”),你可能会对.wsc文件的运行时更改失败。

(man, how did I even remember this)

(伙计,我怎么记得这个)

more info here - quick before it's archived! :D http://www.microsoft.com/technet/scriptcenter/resources/scriptshop/default.mspx

更多信息 - 快速归档之前! :D http://www.microsoft.com/technet/scriptcenter/resources/scriptshop/default.mspx

-Oisin