TrueAnalyticsSolutions / MtconnectCore

Open Source MTConnect library created by True Analytics Manufacturing Solutions
https://mtconnectcore.dev
GNU Affero General Public License v3.0
3 stars 1 forks source link

[BUG] Build fails on branch tbm0115/hard-coded-model #35

Closed mnoomnoo closed 2 days ago

mnoomnoo commented 3 days ago

Describe the bug When trying to build the tbm0115/hard-coded-model branch I get the following errors:

Severity    Code    Description Project File    Line    Suppression State   Details
Error (active)  CS0006  Metadata file 'C:\projects\MtconnectCore\MtconnectCore\bin\Debug\netcoreapp3.1\MtconnectCore.dll' could not be found    MtconnectCoreDocumentation  C:\projects\MtconnectCore\MtconnectCoreDocumentation\CSC    1       
Error (active)  CS0006  Metadata file 'C:\projects\MtconnectCore\MtconnectCore\bin\Debug\netcoreapp3.1\MtconnectCore.dll' could not be found    MtconnectCoreExample    C:\projects\MtconnectCore\MtconnectCoreExample\CSC  1       
Error (active)  CS1001  Identifier expected MtconnectCore (net45), MtconnectCore (netcoreapp3.1), MtconnectCore (netstandard2.0)    C:\projects\MtconnectCore\MtconnectCore\Standard\Contracts\Enums\DataTypes\MediaTypeEnum.cs 20      

To Reproduce Steps to reproduce the behavior:

  1. Checkout MtconnectCore repo
  2. Open the solution file in Visual Studio
  3. Switch to the tbm0115/hard-coded-model branch
  4. In the Solution Explorer, right click the solution and choose Rebuild Solution
  5. Build fails with the errors listed above

Expected behavior Build should succeed

tbm0115 commented 2 days ago

The issue is the transpiler for MtconnectCore does not have a handler for renaming C# entities when they start with a number.

For example, the output from the transpiler: image

To fix this, we must manually prefix it with an underscore according to MS docs.

I've pushed an update to this branch with this fix.