- configuration 1: building ESRI add-ins for ArcMap 10.4 using Visual Studio 2015 targeting the .NET 4.5.2 framework
- configuration 2: building ESRI add-ins for ArcMap 10.3 using Visual Studio 2013 targeting the .NET 3.5 framework
- configuration 3: building ESRI add-ins for ArcMap 10.4 using Visual Studio 2013 targeting the .NET 4.5.2 framework
I'm trying to understand why the Option Strict On enforcement in VB.NET projects does not raise error BC30512 in two projects and it does in another. Here is an an example line of code that triggers the error using configuration 1 but does not trigger the error with configuration 2 or 3.
Dim bufferedPolygon As ESRI.ArcGIS.Geometry.IGeometry = New ESRI.ArcGIS.Geometry.Polygon
Additionally, if I instantiate the managed class instead of the coclass, the error is not triggered in either configuration (see following line):
Dim bufferedPolygon As ESRI.ArcGIS.Geometry.IGeometry = New ESRI.ArcGIS.Geometry.PolygonClass
The different versions of ArcMap dictate which version of the framework is targeted. For additional background, the COM to .NET Type Conversion of the ArcObjects documentation is relevant: Using ArcObjects (COM-based) in .NET (ArcObjects .NET 10.4 SDK)
Why is the error triggered in configuration 1 and not in configuration 2 or 3? And why isn't the error triggered in configuration 1 when instantiated with the managed class instead of the coclass?
Link to an issue submitted at the dotnet/roslyn github repository. https://github.com/dotnet/roslyn/issues/13314
Thanks Shea