0

下面是 Silverlight 应用程序的标准 JavaScript。我得到了4004 errorat throw new Error(errMsg); Object reference not set to an instance of an object。我的主页是silverlight,但用于运行差异应用程序的子文件夹在加载默认页面时出现此错误。一个想法是连接字符串,但我已经检查了规格并与主机站点确认了它们,并且他们同意格式正确。我还需要看什么?IE 控制台中的错误显示在cTor我的一个子 Windows 构造函数中,但我检查了代码并没有发现问题,并且此代码以前运行良好。我可以与托管公司讨论新服务器上可能缺少的东西吗?

    <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>
4

0 回答 0