Author Topic: Error Using C# Visual Studio 2017/2019  (Read 912 times)

arizawilmer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Error Using C# Visual Studio 2017/2019
« on: May 05, 2021, 11:16:35 PM »
I download a fresh version. Usually I work with the .net version but I will need to use c#.


I was transfering a code from net to C# and as soon I put any element and try to do a sevensegment2.value=100D

Visual studio pointed to erros in
 
Code: [Select]
this.digitalPanelMeter1.BackColor = System.Drawing.Color.Transparent;
            this.digitalPanelMeter1.ComComponent = this.ethernetIPforCLXCom1;
            this.digitalPanelMeter1.DecimalPosition = 0;
            this.digitalPanelMeter1.ForeColor = System.Drawing.Color.LightGray;

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: Error Using C# Visual Studio 2017/2019
« Reply #1 on: May 05, 2021, 11:20:22 PM »
Are you using the AdvancedHMIcs project?

arizawilmer

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Error Using C# Visual Studio 2017/2019
« Reply #2 on: May 05, 2021, 11:55:13 PM »
Yes


More detail of the error:
Code: [Select]
[pre]Error CS0012 The type 'SevenSegment2' is defined in an assembly that is not referenced.
You must add a reference to assembly 'MfgControl.AdvancedHMI.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

« Last Edit: May 06, 2021, 12:53:29 AM by arizawilmer »

Godra

  • Hero Member
  • *****
  • Posts: 1439
    • View Profile
Re: Error Using C# Visual Studio 2017/2019
« Reply #3 on: May 06, 2021, 01:05:51 AM »
The latest beta version is already referencing that so it must be some older version that you are using.

Value has capital "V" so it is probably a typo in your first post for: sevensegment2.value=100D

Are you actually trying to set a double value of 100 to sevensegment2?

Godra

  • Hero Member
  • *****
  • Posts: 1439
    • View Profile
Re: Error Using C# Visual Studio 2017/2019
« Reply #4 on: May 06, 2021, 01:14:02 AM »
If it is an older version that you are using then read this post:

   https://www.advancedhmi.com/forum/index.php?topic=2013.msg11297#msg11297