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

“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 关于PLUS模型中kapaa值的问题
  • ¥15 关于博途V17进行仿真时无法建立连接问题
  • ¥15 请问下这个红框里面是什么文档或者记事本编辑器
  • ¥15 机器学习教材中的例题询问
  • ¥15 求.net core 几款免费的pdf编辑器
  • ¥15 为什么安装HCL 和virtualbox之后没有找到VirtualBoxHost-OnlyNetWork?
  • ¥15 C# P/Invoke的效率问题
  • ¥20 thinkphp适配人大金仓问题
  • ¥20 Oracle替换.dbf文件后无法连接,如何解决?(相关搜索:数据库|死循环)
  • ¥15 数据库数据成问号了,前台查询正常,数据库查询是?号