您好,我在Visual Studio专业版上设置应用程序时遇到问题。完成获取代码后,我单击该应用程序,但消息弹出,就像您的应用程序中发生未处理的异常一样。我的框架是.NET Framework 4.5,我下载了MySQL连接器6.9.9版本。而且我不知道我的Windows 10 Pro的64位版本或框架以及MySQL连接器的设置是否错误。
错误消息显示:
有关调用的详细信息,请参阅此消息的末尾 即时(JIT)调试,而不是此对话框。
**************例外文本**************
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName)
at superpos3.Main.pictureBox2_Click(Object sender, EventArgs e) in
D:\superpos3\superpos3\superpos3\Main.cs:line 22
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
superpos3
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/superpos3/superpos3/superpos3/bin/Debug/superpos3.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
MySql.Data
Assembly Version: 6.9.9.0
Win32 Version: 6.9.9.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/MySql.Data/v4.0_6.9.9.0__c5687fc88969c44d/MySql.Data.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4121.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
启用JIT调试后,任何未处理的异常 将被发送到计算机上注册的JIT调试器 而不是由此对话框处理。
我在这里添加了...
main.cs的第22行只是以下代码:System.Diagnostics.Process.Start(“ Word”);
当我单击Main.cs [Design]表单上的Microsoft word应用程序时,出现错误。我认为该错误来自MySQL连接器6.9.9和框架4.5。
我从程序集中添加了MySQL连接器net 6.9.9文件夹的以下文件的引用:
Mysql.Data.dll
Mysql.Data.Entity.dll
MySql.Data.Entity.EF6.dll
Mysql.Fabric.Plugin.dll
Mysql.Web.dll
The codes in Main.cs is:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace superpos3
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void pictureBox2_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Word");
}
private void pictureBox3_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Excel");
}
private void pictureBox4_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("PowerPoint");
}
private void pictureBox5_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Access");
}
private void pictureBox6_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Windows is going to shut down. Are you sure?", "Please confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
System.Diagnostics.Process.Start("shutdown", "/s /t 0");
}
}
private void pictureBox7_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("NotePad");
}
private void pictureBox8_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Calculator");
}
private void pictureBox11_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Google Chrome");
}
private void pictureBox10_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Internet Explorer");
}
private void pictureBox9_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Windows is going to restart. Are you sure?", "Please confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
System.Diagnostics.Process.Start("shutdown", "/r /t 0");
}
}
}
}
答案 0 :(得分:0)
main.cs,第22行就是以下代码:System.Diagnostics.Process.Start(“ Word”);
当我单击Main.cs [Design]表单上的Microsoft word应用程序时,出现错误。 我认为该错误来自MySQL连接器6.9.9和框架4.5。
我从程序集中添加了MySQL连接器net 6.9.9文件夹的以下文件的引用:
Mysql.Data.dll
Mysql.Data.Entity.dll
MySql.Data.Entity.EF6.dll
Mysql.Fabric.Plugin.dll
Mysql.Web.dll
Main.cs中的代码为:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace superpos3
{
public partial class Main : Form
{
public Main()
{
InitializeComponent();
}
private void pictureBox2_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Word");
}
private void pictureBox3_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Excel");
}
private void pictureBox4_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("PowerPoint");
}
private void pictureBox5_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Access");
}
private void pictureBox6_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Windows is going to shut down. Are you sure?", "Please confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
System.Diagnostics.Process.Start("shutdown", "/s /t 0");
}
}
private void pictureBox7_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("NotePad");
}
private void pictureBox8_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Calculator");
}
private void pictureBox11_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Google Chrome");
}
private void pictureBox10_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Internet Explorer");
}
private void pictureBox9_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Windows is going to restart. Are you sure?", "Please confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
System.Diagnostics.Process.Start("shutdown", "/r /t 0");
}
}
}
}
答案 1 :(得分:0)
Microsoft Word可执行文件名为“ winword.exe”,而不是“ word.exe”