Visual Studio 2008 で WPF アプリケーションを構築し、そのインストーラーを作成しました。これまでのところ問題なく動作します。自動更新機能がないことに気付き、いくつかの解決策を試した後、クリックワンス展開を試すことにしました。ダウンロードしたアプリのインストール後にアプリケーションがクラッシュすることに気付きました.これについて不平を言います:
アセンブリ 'MyApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' で定義された 'Login' のインスタンスを作成できません。呼び出しのターゲットによって例外がスローされました。マークアップ ファイル 'MyApplication;component/login.xaml' の行 1 の位置 9 にエラーがあります。
ここにスタックトレースがあります
System.Windows.Markup.XamlParseException.ThrowException (文字列メッセージ、例外 innerException、Int32 lineNumber、Int32 linePosition、Uri baseUri、XamlObjectIds currentXamlObjectIds、XamlObjectIds contextXamlObjectIds、型 objectType)
で System.Windows.Markup.XamlParseException.ThrowException (ParserContext parserContext、Int32 ) System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(文字列メッセージ、例外 innerException)
で System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail) で lineNumber、Int32 linePosition、文字列メッセージ、例外 innerException)
System.Windows.Markup.BamlRecordReader.GetElementAndFlags (BamlElementStartRecord bamlElementStartRecord、Object& 要素、ReaderFlags& フラグ、Type& delayCreatedType、Int16& delayCreatedTypeId)
で System.Windows.Markup.BamlRecordReader.BaseReadElementStartRecord (BamlElementStartRecord bamlElementRecord)
で System.Windows.Markup.BamlRecordReader.ReadElementStartRecord (BamlElementStartRecord bamlElementRecord)
System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
で System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
で System.Windows.Markup .TreeBuilder.Parse()
System.Windows.Markup.XamlReader.LoadBaml (ストリーム ストリーム、ParserContext parserContext、オブジェクトの親、Boolean closeStream)
で System.Windows.Application.LoadBamlStreamWithSyncInfo (ストリーム ストリーム、ParserContext pc)
で System.Windows.Application.LoadComponent (Uri resourceLocator、
System.Windows.Application.DoStartup()
の System.Windows.Application.<.ctor>b__0(オブジェクト未使用)
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) の Boolean bSkipJournaledProperties
) System.Windows.Threading.ExceptionWrapper.TryCatchWhen(オブジェクト ソース、デリゲート コールバック、オブジェクト引数、ブール値 isSingleParameter、デリゲート catchHandler)
System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(オブジェクトの状態) で
System.Windows.Threading.DispatcherOperation.InvokeImpl()で System.Windows.Threading.Dispatcher.WrappedInvoke (デリゲート コールバック、オブジェクト引数、ブール値 isSingleParameter、デリゲート catchHandler) でSystem.Threading.ExecutionContext.runTryCode(Object userData) で System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode コード、CleanupCode backoutCode、Object userData) で System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext、ContextCallback コールバック、オブジェクト状態) でSystem.Threading.ExecutionContext.Run(ExecutionContext 実行コンテキスト、ContextCallback コールバック、オブジェクト状態)
System.Windows.Threading.DispatcherOperation.Invoke()
で System.Windows.Threading.Dispatcher.ProcessQueue()
で System.Windows.Threading.Dispatcher.WndProcHook (IntPtr hwnd、Int32 msg、IntPtr wParam、IntPtr lParam、Boolean& を処理) System.Windows.Threading.ExceptionWrapper.InternalRealCall(デリゲート コール バック
、 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) でのオブジェクト引数、ブール値 isSingleParameter )
System.Windows.Threading.Dispatcher.WrappedInvoke (デリゲート コールバック、オブジェクト引数、ブール値 isSingleParameter、デリゲート catchHandler)
で System.Windows.Threading.Dispatcher.InvokeImpl (DispatcherPriority 優先度、TimeSpan タイムアウト、デリゲート メソッド、オブジェクト引数、ブール値 isSingleParameter)
で
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)のSystem.Windows.Threading.Dispatcher.Invoke(DispatcherPriority 優先度、デリゲート メソッド、オブジェクト引数)
MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame フレーム)
で System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame フレーム) で
System.Windows.Threading.Dispatcher.Run()
で System.Windows.Application.RunDispatcher(Object ignore)
で System.Windows.Application.RunInternal(ウィンドウ ウィンドウ)
で System.Windows.Application.Run(ウィンドウ ウィンドウ)
で システムで.Windows.Application.Run()
at myApplication.App.Main()
これは、デバッガーが指している領域です
<Window x:Class="MyApplication.Login"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:MyApplication"
xmlns:UI="clr-namespace:UI;assembly=UI"
Title="My Application" Height="400" Width="550" ResizeMode="NoResize" WindowStyle="ThreeDBorderWindow" WindowStartupLocation="CenterScreen" Name="Logine" Loaded="Logine_Loaded" Closed="Logine_Closed" Icon="orLogo.ico">
しかし、セットアップ プロジェクトの msi のようなインストーラー バージョンは正常に動作します。そのため、デザイン ビューを使用できるため、エラーの原因がわかりません。
質問 1 : 同様の問題が発生している人はいますか、それとも既知の問題ですか?
質問 2 : それが既知の問題である場合、代替手段は何ですか。クリックオンスをあきらめるかもしれませんが、自動更新機能が失われます (現在見つけられる、オベキルまたは深刻な時代遅れでないものはないため) .
これを読んでくれて、正しい方向に向けてくれてありがとう。