本文介绍了Microsoft JScript运行时错误:Silverlight应用程序代码中的未处理错误:4004类别:ManagedRuntimeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的项目是使用componentart构建的,现在我必须将所有内容更改为telerik,因为我们有多个门户网站并且它们看起来很相似,所以我正在尝试申请它们看起来像是相同的样式和动画,



当我用telerik替换组件艺术工具时它们工作正常,但当我应用它们使用的样式时其他项目,我收到此错误在HostPage.aspx [动态]



和错误是



Microsoft JScript运行时错误:Silverlight应用程序中的未处理错误

代码:4004

类别:ManagedRuntimeError

消息:System.Windows.Markup。 XamlParseException:找不到具有Name / Key的资源ErrorWindowStyle [Line:7 Position:9]

en System.Windows.Application.LoadComponent(Object component,Uri resourceLocator)

en Brightstar.SCP.ErrorWindow.InitializeComponent()

zh B rightstar.SCP.ErrorWindow..ctor(String message,String errorDetails)

zh_cn Brightstar.SCP.ErrorWindow.CreateNew(String message,String stackTrace,StackTracePolicy policy)

zh Brightstar.SCP.ErrorWindow.CreateNew(异常异常,StackTracePolicy策略)

zh_cn Brightstar.SCP.ErrorWindow.CreateNew(异常异常)

zh_cn Brightstar.SCP.App.Application_UnhandledException (Object sender,ApplicationUnhandledExceptionEventArgs e)

en MS.Internal.Error.CallApplicationUEHandler(Exception e)

en MS.Internal.Error.GetXresultForUserException(Exception ex)





HostPage.aspx [动态]文件如下



Hello,
My project is build with "componentart", and now I have to change everything into telerik, becasue we have multiple portals and they have to look alike, so I am trying to apply the same styles and animations as they look like,

when I replace the component art tools with telerik they are working fine, but when I am applying the style they used in other projects,I am receiving this error at the HostPage.aspx[dynamic]

and the error is

Microsoft JScript runtime error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException: Cannot find a Resource with the Name/Key ErrorWindowStyle [Line: 7 Position: 9]
en System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
en Brightstar.SCP.ErrorWindow.InitializeComponent()
en Brightstar.SCP.ErrorWindow..ctor(String message, String errorDetails)
en Brightstar.SCP.ErrorWindow.CreateNew(String message, String stackTrace, StackTracePolicy policy)
en Brightstar.SCP.ErrorWindow.CreateNew(Exception exception, StackTracePolicy policy)
en Brightstar.SCP.ErrorWindow.CreateNew(Exception exception)
en Brightstar.SCP.App.Application_UnhandledException(Object sender, ApplicationUnhandledExceptionEventArgs e)
en MS.Internal.Error.CallApplicationUEHandler(Exception e)
en MS.Internal.Error.GetXresultForUserException(Exception ex)


The HostPage.aspx[dynamic] file is as below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"><title>
    Brightstar Supplier Collaboration Portal
</title>
    <style type="text/css">
        html, body
        {
            height: 100%;
            overflow: hidden;
        }
        body
        {
            padding: 0;
            margin: 0;
        }
        #silverlightControlHost
        {
            height: 100%;
            text-align: center;
        }
    </style>

    <script type="text/javascript" src="Silverlight.js"></script>

    <script type="text/javascript">

        function CloseWindow() {
            window.close();
        }

        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);

        }
    </script>

    <script type="text/javascript">

        function OnSourceDownloadProgressChanged(sender, eventArgs) {

            var oSLHost = document.getElementById("silverlightControlHost");

            // get progress    
            if (eventArgs.progress)
                var progress = Math.ceil(eventArgs.progress * 100) - 1;
            else
                var progress = Math.ceil(eventArgs.get_progress() * 100) - 1;

            // update percent loaded    
            if (sender.findname("uxStatusText") != null) {
                var percentblock = sender.findName("uxStatusText");
                percentblock.Text = "Loading: " + progress.toString() + "%";

                // oImage.Opacity = eventArgs.get_progress();
                // rectBar.Width = eventArgs.progress * rectBorder.Width;
            }

         }

    </script>

</head>
<body style="height:100%;margin:0;">
    <form method="post" action="SCPHostPage.aspx" id="form1" style="height:100%;">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE4NTU4MTI5MzhkZJT0KDA5kx6yk4Q1SuJ7gKkAbhxKOg8SKs7BEXLQi1En" />
</div>


        <div id="silverlightControlHost">
                <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"

            width="100%" height="100%">
            <param name="source" value="ClientBin/Brightstar.SCP.xap?-544696752" />
            <param name="splashScreenSource" value="SplashScreen.xaml" />
            <param name="onSourceDownloadProgressChanged" value="OnSourceDownloadProgressChanged" />
            <param name="onError" value="OnSilverlightError" />
            <param name="background" value="white" />
            <param id="initParams" name="initparams" value=""></param>
            <param name="minRuntimeVersion" value="4.0.50401.0" />
            <param name="uiculture" value="es" />
            <param name="culture" value="es-ES" />
            <param name="autoUpgrade" value="true" />

            <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none">
                <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"

                    style="border-style: none" />
            </a>
        </object>

        </div>
        <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px; border: 0px"></iframe>
    </form>
</body>
</html>







任何人都可以帮我解决这个问题,非常感谢。




Can anyone help me out with this, please, Thank you very much.

推荐答案

Quote:

消息:System.Windows.Markup.XamlParseException:无法找到名称/键ErrorWindowStyle的资源[行:7位置:9]

Message: System.Windows.Markup.XamlParseException: Cannot find a Resource with the Name/Key ErrorWindowStyle [Line: 7 Position: 9]



这意味着,在某些xaml文件中你引用了erence StaticResource ErrorWindowStyle,但您的应用程序中没有此类资源。

这不是关于jscript或aspx的页面,而是关于你的xaml


It means, that in some xaml file you reference StaticResource ErrorWindowStyle, but there is no such resource in your application.
It''s not about jscript or aspx page, it''s about your xaml


这篇关于Microsoft JScript运行时错误:Silverlight应用程序代码中的未处理错误:4004类别:ManagedRuntimeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 18:30