在iis中托管时出错 [英] error when hosted in iis

查看:136
本文介绍了在iis中托管时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在Powershell提示符下使用asp.net,C#调用Powershell脚本.当我使用Visual Studio运行应用程序时,它在同一系统上可以正常工作,但是当我在同一系统上的iis中托管相同的网站时,会报错.

表示在iis中托管站点后脚本无法访问数据错误是:

您不能在空值表达式上调用方法.在C:\ shutdown.ps1:17 char:37+ $ result = $ vmshut.InitiateShutdown<<<< ("$ true",无评论")+ CategoryInfo:InvalidOperation:(InitiateShutdown:String)[],RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull无法关闭wintest

解决方案

结果=


vmshut.InitiateShutdown<<<< ("


true",无评论")+ CategoryInfo:InvalidOperation:(InitiateShutdown:String)[],RuntimeException + FullyQualifiedErrorId:InvokeMethodOnNull无法关闭wintest

Hi,

i am calling powershell script using asp.net,C#,on powershell prompt.when i run application using visual studio its works fine on same system,but when i host same website in iis on same system it gives error.

means script unable to access to data error after hosting site in iis is:

You cannot call a method on a null-valued expression.At C:\shutdown.ps1:17 char:37+ $result = $vmshut.InitiateShutdown <<<< ("$true","no comment") + CategoryInfo : InvalidOperation: (InitiateShutdown:String) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull unable to shutdown wintest

解决方案

result =


vmshut.InitiateShutdown <<<< ("


true","no comment") + CategoryInfo : InvalidOperation: (InitiateShutdown:String) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull unable to shutdown wintest


这篇关于在iis中托管时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆