none
Compiler error when SCOM 2012 R2 SDK compiled using Visual studio 2013

    Question

  • I have the connector written using 2007 SDK , Now I am trying to buidl the same code using the SCOM 2012 SDK dll . by replacing the following dll

    1. Microsoft.EnterpriseManagement.OperationsManager.Common.dll
    2. Microsoft.EnterpriseManagement.OperationsManager.dll

    with scom 2012 sdk dlls

    1. Microsoft.EnterpriseManagement.Core.dll
    2. Microsoft.EnterpriseManagement.OperationsManager.dll
    3. Microsoft.EnterpriseManagement.Runtime.dll

    Note :

    I copied the the Operations Manager software development kit (SDK) binaries  located at  %ProgramFiles%\System Center 2012\Operations Manager\Server\SDK Binaries\ folder.

    when I compiled the code using Visual studio 2008 :

    Compilation successful and connector is working fine.

    when I compiled the code using Visual studio 2013 :

    Compilation failed with following error :

    *******************

    c:\spectrum_10.2_vs2013\mom.a\lib\microsoft.enterprisemanagement.core.dll : warning C4945: 'MonitoringTaskCredentials' : cannot import symbol from 'c:\spectrum_10.2_vs2013\mom.a\li
    b\microsoft.enterprisemanagement.core.dll': as 'Microsoft::EnterpriseManagement::Configuration::MonitoringTaskCredentials' has already been imported from another assembly 'Microsof
    t.EnterpriseManagement.OperationsManager'
            c:\spectrum_10.2_vs2013\mom.a\lib\microsoft.enterprisemanagement.operationsmanager.dll : see declaration of 'Microsoft::EnterpriseManagement::Configuration::MonitoringTaskC
    redentials'
            first seen type is used; re-order imported assemblies to use the current type
            This diagnostic occurred while importing type 'Microsoft.EnterpriseManagement.Configuration.MonitoringTaskCredentials' from assembly 'Microsoft.EnterpriseManagement.Core, V
    ersion=7.0.5000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
    c:\Spectrum_10.2_VS2013\Mom.a\scom\src\SCOMConnectorMgr.cc(132) : fatal error C1001: An internal error has occurred in the compiler.
    (compiler file 'f:\dd\vctools\compiler\cxxfe\sl\p1\c\esu.c', line 6378)
     To work around this problem, try simplifying or changing the program near the locations listed above.
    Please choose the Technical Support command on the Visual C++

    *******************************************

    The same code is working fine when i compiled using vs 2008 .

    This is code at line 132 :

     mgtGroup = ManagementGroup(scomHost );

    Is it a version compatibilty issue ( .net framework / visual studio )

    Please advise.


    shiva

    Tuesday, May 24, 2016 12:59 PM

Answers