C# app: 32 vs 64 bit question

When creating a C# project, should I reference the BrxMgd.dll in the BricsCAD install folder? Or is there an SDK version(s) to download (or build)?
Are there different versions for 32 vs 64 bit?

I'm currently referencing the version that's installed with BricsCAD.
Here's the problem:
The version installed with BricsCAD appears to be 64bit only.
When building my C# project, I get an error/warning related to referencing a dll that is targeting 64bit while the project is targeting any CPU.

I can switch the project to target 64bit, but I will presumably still have an issue with building for a 32bit target. (because I don't have the 32 bit version of the dll)

For comparison:
Autodesk includes AcMgd.dll in the ARX SDK and it appears to target "Any CPU". (i.e. one version of the file)

On the other hand, BrxMgd.dll does not appear to be included in the BRX SDK. (maybe it can be built? Maybe I should download it?)

Here's an example of the full message from Visual Studio:
warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "BrxMgd", "AMD64". 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.

My setup info:
Microsoft Visual Studio Community 2017
Version 15.7.4

BricsCAD v18: Version 18.2.14 (x64) revision 54509

Thanks in advance for any info,

  • Randy

Comments

  • The installed 64-bit DLL on your system and the 32-bit DLL from a 32-bit version of BricsCAD both expose the same interfaces, so your "Any CPU" DLL will load and run in either architecture. The installed DLLs are mixed (include native code), so they cannot themselves be "Any CPU".

  • Thanks!
    Summary:

    • Use the dll from BricsCAD install folder.
    • Ignore the build warning. MSB3270
  • Quick bit of added info that was not obvious to me...
    How to get Visual Studio to ignore warning MSB3270.
    Open the csproj file in notepad, and add the following:
    <PropertyGroup> <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch> </PropertyGroup>
    Hope that helps someone save a bit of time.

This discussion has been closed.