ttlily萝 2017-11-22 01:43 采纳率: 0%
浏览 2154

“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();
    }
}

}

  • 写回答

2条回答

  • 菜小鸡腿儿 2017-11-22 02:12
    关注

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

    评论

报告相同问题?

悬赏问题

  • ¥15 优质github账号直接兑换rmb,感兴趣伙伴可以私信
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)