Не могу запустить примеры из папки SDK для C# (VS 2012)

Автор BD11, 15.02.14, 20:36:19

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

BD11

Здравствуйте! Подскажите пожалуйста, что надо сделать, чтобы запустить примеры из папки SDK для C# (VS 2012). Я нашел несколько примеров на C# выложенных на форуме (http://forum.ascon.ru/index.php?topic=23942.0) и они работают. Почему примеры из папки SDK не запускаются не знаю.

Если запустить любую программу (за исключением ksContr) вылетает ошибка:


При попытаться откомпилировать проект возникают 3 ошибки и 7 предупреждений:
Warning 1 Type library exporter warning processing 'Steps.NET.Step11.GetLibraryName(#0), Step11'. Warning: The method or field has an invalid ELEMENT_TYPE/NATIVE_TYPE combination. Step11

Warning 2 Type library exporter warning processing 'Steps.NET.Step11.CALLBACKPROCCOMMANDWINDOW(rInfo), Step11'. Warning: The method or field has an invalid ELEMENT_TYPE/NATIVE_TYPE combination. Step11

Warning 3 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "c:\Program Files (x86)\ASCON\KOMPAS-3D V14\SDK\C#\Common\KAPITypes.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. ksContr

Warning 4 Could not determine the dependencies of the COM reference "KGAXLib". Ошибка при загрузке библиотеки. (Exception from HRESULT:

0x80029C4A (TYPE_E_CANTLOADLIBRARY)) ksActiveX

Warning 5 Could not determine the dependencies of the COM reference "AxKGAXLib". Ошибка при загрузке библиотеки. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)) ksActiveX

Error 6 The assembly "c:\Program Files (x86)\ASCON\KOMPAS-3D V14\SDK\C#\Automation\Gayka.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'Steps.NET.GaykaObj.DrawPosLeader(spc), Gayka'. Error: Referenced type is defined in managed component, which is imported from a type library that could not be loaded (type: 'Kompas6API5.ksSpecification'; component: 'c:\Program Files (x86)\ASCON\KOMPAS-3D V14\SDK\C#\Automation\Kompas6API5.dll'). Gayka

Warning 7 Type library exporter warning processing 'Steps.NET.Step4.CALLBACKPROCCURSOR(rInfo), Step4'. Warning: The method or field has an invalid ELEMENT_TYPE/NATIVE_TYPE combination. Step4

Warning 8 Type library exporter warning processing 'Steps.NET.Step4.CALLBACKPROCPLACEMENT(rInfo), Step4'. Warning: The method or field has an invalid ELEMENT_TYPE/NATIVE_TYPE combination. Step4

Error 9 The assembly "c:\Program Files (x86)\ASCON\KOMPAS-3D V14\SDK\C#\Automation\Step12.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'Steps.NET.ApplicationEvent, Step12'. Error: Referenced type is defined in managed component, which is imported from a type library that could not be loaded (type: 'Kompas6API5.ksKompasObjectNotify'; component: 'c:\Program Files (x86)\ASCON\KOMPAS-3D V14\SDK\C#\Automation\Kompas6API5.dll'). Step12

Error 10 The assembly "c:\Program Files (x86)\ASCON\KOMPAS-3D V14\SDK\C#\Automation\EventsAuto.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'Steps.NET.ApplicationEvent, EventsAuto'. Error: Referenced type is defined in managed component, which is imported from a type library that could not be loaded (type: 'Kompas6API5.ksKompasObjectNotify'; component: 'c:\Program Files (x86)\ASCON\KOMPAS-3D V14\SDK\C#\Automation\Kompas6API5.dll'). EventsAuto



При запустить ksContr открывается форма с кнопками, но большинство кнопок приводят к ошибке. Работают кнопки: «Graphic Load» открывающая Компас, «New File» создающая документ, «Выполнить команду» которая рисует две окружности и кнопка «Управление видимостью».



Возможно мне нужно изменить настройки VS?

KrissKross

Visual Studio Вам даже подсказывает, Что
A project with an Output Type of Class Library cannot be started directly
Проект с выходным типом Библиотека Классов не может быть запущена напрямую

т.е. Class Library - создает динамическую библиотеку с расширением dll
чтобы увидеть результаты работы

1. Самое простое
Открыть Компас
в Менеджере библиотек -
Добавить описание - прикладной библиотеки
искать на вкладке ActiveX

2. Самое правильное (для серьезной разработки)
Подключить запускаемый экземпляр Компас-3Д
после компиляции библиотеки
в свойствах проекта Visual Studio
и не спрашивайте как - не знаю
+ Благодарностей: 1