アプリケーションを起動すると、例外が発生します。何が原因でしょうか?
例外は、コンストラクターの行にあります。
checkBox1.Checked = Options_DB.Get_Automatic_Start();
これはoptions_db
クラスですが、そこでブレークポイントを使用しましたが、決して到達しませんoptions_db
これは form1 で、例外が発生するコンストラクターです。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using DannyGeneral;
using System.Drawing.Drawing2D;
namespace Batch_Images_Convertion
{
public partial class Form1 : Form
{
int i;
bool cancel_;
bool automatic_;
public Form1()
{
InitializeComponent();
i = 0;
automatic_ = false;
checkBox1.Checked = Options_DB.Get_Automatic_Start();
この線を超えて続くことはありません。
これは例外エラー メッセージです。
System.TypeInitializationException was unhandled
Message=The type initializer for 'Batch_Images_Convertion.Options_DB' threw an exception.
Source=Batch_Images_Convertion
TypeName=Batch_Images_Convertion.Options_DB
StackTrace:
at Batch_Images_Convertion.Options_DB.Get_Automatic_Start()
at Batch_Images_Convertion.Form1..ctor() in D:\C-Sharp\Batch_Images_Convertion\Batch_Images_Convertion\Batch_Images_Convertion\Form1.cs:line 26
at Batch_Images_Convertion.Program.Main() in D:\C-Sharp\Batch_Images_Convertion\Batch_Images_Convertion\Batch_Images_Convertion\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.DirectoryNotFoundException
Message=Could not find a part of the path 'C:\Users\Chocolade\AppData\Local\Microsoft\Batch_Images_Convertion\settings\settings_convertion.txt'.
Source=mscorlib
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.File.Create(String path)
at DannyGeneral.OptionsFile..ctor(String settings) in D:\C-Sharp\Batch_Images_Convertion\Batch_Images_Convertion\Batch_Images_Convertion\OptionsFile.cs:line 72
at Batch_Images_Convertion.Options_DB..cctor() in D:\C-Sharp\Batch_Images_Convertion\Batch_Images_Convertion\Batch_Images_Convertion\Options_DB.cs:line 25
InnerException: