none
Error BC30799 Field [] has an invalid constant value - VS 2015 error, ok in VS 2013

    Question

  • I have a project that references the ESRI map object dll below and getting compile errors when built from VS 2015. No issues when compiling from VS 2013.

    Error BC30799 Field 'AlignmentConstants.moAlignBottom' has an invalid constant value

    ESRI.MapObjects2.Core.dll

    Runtime Version: v1.0.3705

    Dll Version: 2.4.1.0

    Checking the definition of the enum through References, Object Browser in VS 2015,  the integer assigned to the enumeration constant is missing:

    Public Const moAlignBottom As ESRI.MapObjects2.Core.AlignmentConstants
        Member of ESRI.MapObjects2.Core.AlignmentConstants

    Below is the definition of the enum through References, Object Browser in VS 2013:

    Public Const moAlignBottom As ESRI.MapObjects2.Core.AlignmentConstants = 2
         Member of ESRI.MapObjects2.Core.AlignmentConstants

    I don't know why the integer constant is being dropped in VS 2015.   Thought maybe the Runtime Version's too old so I tried relinking the dll to newer framework and re-referencing but didn't make a difference.

    Is this a 2015 IDE issue?

    Edit: I should add that all integer constants are dropped from all enumeration members in 2 ESRI mapobject dlls referenced in VS 2015, fine in VS 2013
    • Edited by JacintoBarcy Tuesday, February 09, 2016 3:32 PM Additional Info
    Tuesday, February 09, 2016 3:27 PM

Answers

All replies

  • Hi JacintoBarcy,

    Before we merge the old project to the new VS version, we would think about the VS compatibility:

    https://msdn.microsoft.com/en-us/library/hh266747.aspx?f=255&MSPPError=-2147217396

    >>I have a project that references the ESRI map object dll below and getting compile errors when built from VS 2015. No issues when compiling from VS 2013.

    Just to make this issue clearly, do you mean that it is related to the third party library?

    http://support.esri.com/en/

    Since we don't support the third party library, I suggest you post this issue to the ESRI site, we have to know that whether the specific dll file supports the VS2015 version even if it works well in VS2013.

    Note: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

    Microsoft does not control these sites and has not tested any software or information found on these sites;

    Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, February 10, 2016 2:15 PM
    Moderator
  • Thanks for the response.

    We want to start using VS 2015 and drop VS 2013 altogether.  All our VS 2013 projects are now opened and compiled in VS 2015, no issues there whatsoever. The only issue is with referencing an old .Net dll.

    The ESRI dlls are old, but they are .Net dlls.  VS 2015 supports referencing and calling methods from .Net dlls built from .Net 1.+ right? Even COMs? So I don't understand why these ESRI dlls which worked in VS 2005, VS 2008, VS 2010, VS 2013 would not work properly when referenced in VS2015. I can send the dlls and you can just browse the definition in VS2015 Object Browser and you'll see the issue. 

    Wednesday, February 10, 2016 9:32 PM
  • Hi JacintoBarcy,

    Just to make this issue clearly, which developing language did you use, VC++, C# or others?

    For example, if the app was based on the .NET, since it worked well in old VS version, how about changing the .net framework version in the project property? Whether the different VS versions are installed in the same windows machine?

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 11, 2016 2:34 PM
    Moderator
  • Hi,

    Created a simple windows form app in VB.Net, referenced the ESRI dll and just assigned one of the enum constants to a variable (intellisense did not show the integer value of the enum constant) and tried showing in a messagebox, it wouldn't even compile.

    Did the exact same in C#, at least it compiled there and intellisense actually showed the integer value of the enum constant (but through Object Browser it's still blank). On runtime I get TypeLoadException though.

    Changing the .Net framework version in Project properties didn't make a difference.  My machine has both VS 2013 and VS 2015 but I have tested in a machine that only has VS 2015 and still didn't work.

    Thanks


    Thursday, February 11, 2016 9:37 PM
  • Hi JacintoBarcy,

    To really repro this issue in my side, if possible, please attach your Visual Studio project, you can upload it to the one drive, and then share the download link in your post. Please also attach a screenshot image in your post about how you really reference to the ESRI map object dll, so I could really repro it in my side.

    Of course, as you said that if we make sure that it really has this issue in VS2015, you can submit this feedback to Microsoft Connect feedback portal: http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx,Microsoft engineers will evaluate them seriously. But you'd better to share a simple sample in your connect report if you really submit a report, so the product team experts could really download your sample and repro this issue, I will also download it and debug it in my side, if I get the same issue as yours, I will help you vote it.

    If there's any concern, please feel free to let me know.

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, February 15, 2016 3:20 AM
    Moderator
  • Thanks Jack.

    Below is the link to a zip file with 2 projects. One is a VS 2013 windows form project referencing the ESRI dll and a button that displays an enumeration constant in a message box which works. The other project is a VS 2015 project which does the exact same, but wouldn't compile even.

    ZipProject



    Wednesday, February 17, 2016 2:15 AM
  • Hi JacintoBarcy,

    I got the same issue in my VS2015.

    To get the issue confirmed and diagnose by product team, would you please create connect report for it? You will get email notification for update. http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, February 18, 2016 6:54 AM
    Moderator
  • Just did. Thanks for your help and confirmation
    Thursday, February 18, 2016 5:12 PM
  • Hi JacintoBarcy,

    https://connect.microsoft.com/VisualStudio/Feedback/Details/2373863

    As you already submit one feedback on the Microsoft Connect site, let's focus on the case on that channel, may our senior members can provide more professional support.

    Thanks,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, February 19, 2016 3:25 AM
    Moderator
  • Hi Jack,

    The comments at the connect report say "We are addressing it in the next update of VS". The next update (VS2015 Update 3) has been released and the bug is not fixed. Will it be fixed in Update 4? What can we do in the meantime to compile our projects with VS2015? The link to post comments at the report is not working for me.

    Thanks,

    Héctor

    Wednesday, June 29, 2016 1:47 PM
  • @Héctor,

    I help you add a comment in the connect report here:

    https://connect.microsoft.com/VisualStudio/Feedback/Details/2373863

    Best Regards,

    Jack


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, June 30, 2016 6:43 AM
    Moderator
  • Hi Jack,

    The comments at the connect report say "We are addressing it in the next update of VS". The next update (VS2015 Update 3) has been released and the bug is not fixed. Will it be fixed in Update 4? What can we do in the meantime to compile our projects with VS2015? The link to post comments at the report is not working for me.

    Thanks,

    Héctor

    Suggested fix from MS:

    Steps to change the IL code.
    1)	Open the Visual studio command prompt.
    2)	Navigate to the directory where you have the Dll “ESRI.MapObjects2.Core.il”
    3)	Run the below command to disassemble the Dll to IL code.
    ildasm /out=ESRI.MapObjects2.Core.il ESRI.MapObjects2.Core.dll
    4)	Open the file “ESRI.MapObjects2.Core.il” in the notepad.
    5)	Search for the string “public static literal valuetype ESRI.MapObjects2.Core.AlignmentConstants moAlignTop”
    6)	Modify the above line from “.field private specialname rtspecialname int32 value__” to “.field public specialname rtspecialname int32 value__”
    7)	Run the command “ilasm ESRI.MapObjects2.Core.il /dll /output:ESRI.MapObjects2.Core.dll” to assemble the IL code to DLL.
    8)	Use the new Dll for your application.

    Thursday, June 30, 2016 1:24 PM
  • Sorry I should've updated this thread as soon as I got a working fix from MS.  Connect report's been updated with the fix and I replied to Hector above.
    Thursday, June 30, 2016 1:27 PM