VSCodeにてC#でBricscadを使おうとすると下記エラーが発生します。
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'BrxMgd, Version=23.2.7.0, Culture=neutral, PublicKeyToken=null'. 指定されたファイルが見つかりません。
File name: 'BrxMgd, Version=23.2.7.0, Culture=neutral, PublicKeyToken=null'
at DotNetTest.Class1.Main(String[] args)
ご教示お願いいたします。
・環境
Windows11 Pro
VSCode
Build Tools for Visual Studio 2022
BricsCADV23.2.07
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bricscad.Runtime;
using Teigha.DatabaseServices;
using Teigha.Geometry;
using Bricscad.ApplicationServices;
using Bricscad.EditorInput;
using Teigha.Runtime;
namespace DotNetTest
{
public class Class1
{
[CommandMethod("Hello")]
static void Main(string[] args)
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
using (Transaction tr = doc.TransactionManager.StartTransaction())
{
Database db = doc.Database;
ObjectId id = SymbolUtilityServices.GetBlockModelSpaceId(db);
BlockTableRecord model = tr.GetObject(id, OpenMode.ForWrite) as BlockTableRecord;
DBText ntext = new DBText();
ntext.SetDatabaseDefaults();
ntext.Height = 20;
Point3d pos = new Point3d(200, 100, 0);
ntext.Position = pos;
ntext.TextString = "Hello World !";
model.AppendEntity(ntext);
ed.WriteMessage("Hello World !");
tr.Commit();
}
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="BrxMgd">
<HintPath>C:\Program Files\Bricsys\BricsCAD V23 ja_JP\BrxMgd.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="TD_Mgd">
<HintPath>C:\Program Files\Bricsys\BricsCAD V23 ja_JP\TD_Mgd.dll</HintPath>
<Private>False</Private>
</Reference>
<COMReference Include="BricscadApp">
<Guid>{96586CB6-6D0C-416C-A680-B6D55C40C09C}</Guid>
<VersionMajor>23</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="BricscadDb">
<Guid>{88161633-E57E-4FCE-A6F3-94FFEA20879A}</Guid>
<VersionMajor>23</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="BricscadSm">
<Guid>{8044A067-A790-4400-A11B-75219A182148}</Guid>
<VersionMajor>23</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
</Project>