0
WPFでアプリケーションをポーリングするだけのアプリを作成しました。今私はWindowsのスタートアップ(ユーザーのログイン後)でそのアプリを起動したい。私はまた、Software \ Microsoft \ Windows \ CurrentVersion \ Runにレジストリキーを追加するWix Toolsetを使ってインストーラパッケージを作成しました。プログラムは実際には実行しようとしますが、エラーは発生しません。 イベントビューアからエラーが発生しましたが、このエラーがどこで発生したのかわかりません。Wpfアプリケーション起動時に起動しないで手動で実行しますか?
スタックトレース:
Application: icBlync.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.DirectoryNotFoundException
at System.IO.__Error.WinIOError(Int32, System.String)
at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)
at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCacheOption, System.Guid ByRef, Boolean ByRef, System.IO.Stream ByRef, System.IO.UnmanagedMemoryStream ByRef, Microsoft.Win32.SafeHandles.SafeFileHandle ByRef)
at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(System.Uri, System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Net.Cache.RequestCachePolicy, Boolean)
at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(System.Uri, System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Net.Cache.RequestCachePolicy)
at System.Windows.Media.Imaging.BitmapFrame.Create(System.Uri, System.Net.Cache.RequestCachePolicy)
at System.Windows.Media.Imaging.BitmapFrame.Create(System.Uri)
at icBlync.Windows.SettingWindow..ctor()
at icBlync.App..ctor()
at icBlync.App.Main()
Plsのヘルプ。
まあ、それが開始されるアプリ(icBlync.exe)のように見える私に:
私はちょうど使用してインストールしたディレクトリに作業ディレクトリを変更しました。ファイルやディレクトリにアクセスしようとすると(読み書き)、ディレクトリがまだ作成されていないために破損します。ファイルシステム操作を行うコードを持っていますか、インストーラがすべての必要なパスを作成していることを確認していますか? –作業ディレクトリが同じでない可能性があるので、相対パスを使用している場合は問題がある可能性があります。 –
私が手動で実行すると、アプリケーションが完全に実行されます。このエラーは自動起動時に発生します。 –