一旦使用Autodesk库中的数据类型,C#中的控制台应用程序将无法执行 [英] Console app in C# fails to execute as soon as data types in Autodesk libraries are used
问题描述
我正在用C#开发一些AutoCAD附加组件,我希望首先在控制台应用程序中工作/调试类,直到准备好在AutoCAD中实现功能为止。 / dot网络库无法卸载,每次修改代码后都需要重新启动/重新加载acad /
有趣的是,我发现,只要声明一个使用autocad数据类型的变量,我的控制台应用程序就会拒绝运行,Im在Visual Studio中显示应用程序处于中断模式屏幕。例如,此代码不会运行:
I'm developing some AutoCAD add-ons in C# and I was hoping to work/debug my classes in a console application first until I'm ready to implement the functionality inside AutoCAD. /dot net libraries cannot be unloaded and one needs to restart/reload acad each time the code is modified/ Interestingly I'm finding that as soon as I declare a variable which uses an autocad data type my console app refuses to run and Im presented with a "the application is in break mode" screen in visual studio. For example this code does not run:
using System;
using Autodesk.AutoCAD.Geometry;
namespace TestConsole
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hi");
Point2d p;
Console.ReadKey();
}
}
}
尝试参考Autodesk C3D 2016 dll库。有人对这里发生的事情和/或任何变通办法有解释吗?
thnks
Trying this referencing Autodesk C3D 2016 dll libraries. Does anyone have an explanation of what is going on here and/or any workarounds? thnks
推荐答案
AutoCAD .NET API设计为仅在进程内运行。
AutoCAD .NET库只能用于构建必须在AutoCAD中加载才能执行的插件(DLL)。
The AutoCAD .NET API is designed to run in-process only. AutoCAD .NET libraries can only be used to build plug-ins (DLL) which have to be loaded in AutoCAD for execution.
这篇关于一旦使用Autodesk库中的数据类型,C#中的控制台应用程序将无法执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!