I have an enum declared as follows:
public enum ProductSku { NotSet = 0, CPO2D = 1, CPO3D = 2 CPO2Ds = 3, etc etc }
Edit: Now I see that the TypeScript definition for ProductSku was wrong, it looked like this:
export enum ProductSku { CPO2D = 0, CPO3D = 1, CPO2Ds = 2, CPO3Ds = 3, CPOComplete = 4, NotSet = 0, }
As you can see, I assigned 1 to CPO2D, but when I use it in the TypeScript class, it has a value of 0 (see screenshot below)
Screenshot in Visual Studio:

What i tried
I saved everything, rebuilt the project, and also closed and reopened Visual Studio
I changed CPO2D to CPO2Ds (expecting the value to be 3 ), which is assigned 2
This may be a very simple explanation, but I donβt see what I am doing wrong ...
enums c # typescript
NRKirby
source share