Errors while creating custom VB.NET subassemblies

Errors while creating custom VB.NET subassemblies

denes.nagy
Contributor Contributor
284 Views
2 Replies
Message 1 of 3

Errors while creating custom VB.NET subassemblies

denes.nagy
Contributor
Contributor

Hi,

I'm trying to generate a proper VB.NET project in Visual Studio for making custom subassemblies but I can't find the reason regarding the following anomaly (I'm just testing the method with the sample files):

I made a copy of the "...\Sample\Civil 3D API\C3DstockSubAssemblies" folder and opened the "C3DStockSubassemblies" project file. The .vb files there have no issues (0 errors, 0 warnings).

denesnagy_0-1688047215257.png

But when I made a brand new project with the same options and same references and same .vb files I got a bunch of errors and some warnings.

denesnagy_1-1688047320255.png

Do you have any idea what is the reason of that?

The Visual Studio helped me out that for example the "Imports Autodesk.Civil.Runtime" line fixes the "'CorridorState' is not defined" error but I'm still curious what is the difference between the sample project file and the created one. The vb scripts of the sample project file don't include the "Imports Autodesk.Civil.Runtime" line and work well...

0 Likes
Accepted solutions (1)
285 Views
2 Replies
Replies (2)
Message 2 of 3

Jeff_M
Consultant
Consultant
Accepted solution

I don't use VB so not sure how these would be added in Visual Studio...looking at the vbproj file for the stock subassemblies there are  number of Imports that are defined there:

<ItemGroup>
<Import Include="Autodesk.AutoCAD.DatabaseServices" />
<Import Include="Autodesk.Civil" />
<Import Include="Autodesk.Civil.ApplicationServices" />
<Import Include="Autodesk.Civil.DatabaseServices" />
<Import Include="Autodesk.Civil.Runtime" />
<Import Include="Autodesk.Civil.Settings" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
</ItemGroup>

 

Replacing the Import Include ItemGroup in the vsproj file with the above removes all those errors.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 3

denes.nagy
Contributor
Contributor

Many thanks! Good to know that these files can be read in XML Notepad as well...

Since then I noticed that where can I customize these general imports in Visual Studio:

denesnagy_0-1688103879723.png