“System.IO.FileNotFoundException”

图片说明图片说明
c#创建一个MenuItem快捷菜单,添加的引用位置正确,然后在调试的时候出现异常引发的异常:“System.IO.FileNotFoundException”(位于 System.s.Forms中)Window
这是创建代码
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;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.Geometry;
[assembly:CommandClass(typeof(WindowsFormsApplication4.Form1))]
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

    private void mi1_Click(object sender, EventArgs e)
    {

        Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
        doc.SendStringToExecute("Line\n", true, false, true);

    }

    private void mi2_Click(object sender, EventArgs e)
    {
        Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
        doc.SendStringToExecute("Circle\n", true, false, true);
    }

    private void ce_Click(object sender, EventArgs e)
    {
        ToolStripMenuItem windowMenu = new ToolStripMenuItem();
    }
private static void Show(Point mousePosition)
    {
        throw new NotImplementedException();
    }
}

}

名字空间,可以手动的去修改,但是我们这个类库文件对应的AssemblyName,还是以前的那个,因此,系统会提示,找不到那个程序集,问题找到了,解救的办法,也就找到了。打开 项目的属性(例如:我的是DLinqDAL),将AssemblyName修改为我们需要的名称。重新生成一次,看看。问题应该就能解决了 。

这个简单 重启就是