以下是silverlight应用程序的标准javaScript。我在4004 error
throw new Error(errMsg);
获得Object reference not set to an instance of an object
。我的主页工作是silverlight,但用于运行diff应用程序的子文件夹在加载默认页面时出现此错误。一个想法是连接字符串,但我检查了规格并确认它们与主机网站,他们同意格式是正确的。还有什么我需要看的? IE控制台中的错误显示在我的一个Child Windows构造函数的cTor
处,但是我已经检查了代码并且看到没有问题,并且此代码以前运行正常。新服务器上有什么东西可能遗漏了我可以和托管公司谈谈吗?
<script type="text/javascript">
function onSilverlightError(sender, args) {
var appSource = "";
if (sender != null && sender != 0) {
appSource = sender.getHost().Source;
}
var errorType = args.ErrorType;
var iErrorCode = args.ErrorCode;
if (errorType == "ImageError" || errorType == "MediaError") {
return;
}
var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";
errMsg += "Code: " + iErrorCode + " \n";
errMsg += "Category: " + errorType + " \n";
errMsg += "Message: " + args.ErrorMessage + " \n";
if (errorType == "ParserError") {
errMsg += "File: " + args.xamlFile + " \n";
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
else if (errorType == "RuntimeError") {
if (args.lineNumber != 0) {
errMsg += "Line: " + args.lineNumber + " \n";
errMsg += "Position: " + args.charPosition + " \n";
}
errMsg += "MethodName: " + args.methodName + " \n";
}
throw new Error(errMsg);//error here
}
</script>