How to replace obsolete class?

5410
19
Jump to solution
05-01-2013 08:25 AM
AnatolySenchenko
New Contributor
For insert records in  Featureclass I use:

        Using comReleaser As ESRI.ArcGIS.ADF.ComReleaser = New ESRI.ArcGIS.ADF.ComReleaser()
            comReleaser.ManageLifetime(featureBuffer)
            comReleaser.ManageLifetime(insertCursor)


I get the Warning : 'ESRI.ArcGIS.ADF.ComReleaser' is obsolete: 'The assembly containing this class is obsolete.  Reference the ESRI.ArcGIS.ADF.Connection.Local assembly instead.'.

How to replace obsolete class ESRI.ArcGIS.ADF.ComRelease?
Example, please.
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
You can use the same syntax, but you need to add the reference ESRI.ArcGIS.ADF.Connection.Local

This reference is not found in the Add ArcGIS References list, but in the full Add Reference list

[ATTACH=CONFIG]23905[/ATTACH]

After adding the reference, you'll have to go into its properties and manually change the Specific Version to False

View solution in original post

0 Kudos
19 Replies
KenBuja
MVP Esteemed Contributor
You can use the same syntax, but you need to add the reference ESRI.ArcGIS.ADF.Connection.Local

This reference is not found in the Add ArcGIS References list, but in the full Add Reference list

[ATTACH=CONFIG]23905[/ATTACH]

After adding the reference, you'll have to go into its properties and manually change the Specific Version to False
0 Kudos
RichWawrzonek
Occasional Contributor
Change the reference to ESRI.ArcGIS.ADF.Connection.Local
There was a recent discussion on here about why the COM releaser isn't a good idea. I've been having good results using Marshal.ReleaseComObject(<your object>) instead.

some more info here:
http://forums.arcgis.com/threads/4298-What-s-Up-with-ComReleaser-Is-it-really-working
http://forums.arcgis.com/threads/75186-Memory-leak-with-FeatureClass-object
0 Kudos
AnatolySenchenko
New Contributor
You can use the same syntax, but you need to add the reference ESRI.ArcGIS.ADF.Connection.Local

This reference is not found in the Add ArcGIS References list, but in the full Add Reference list

[ATTACH=CONFIG]23905[/ATTACH]

After adding the reference, you'll have to go into its properties and manually change the Specific Version to False


I find in ArcGIS References list ESRI.ArcGIS.ADF.Connection.Local add the reference and change the Specific Version to False in its properties.
Nothing has changed:
Warning 'ESRI.ArcGIS.ADF.ComReleaser' is obsolete: 'The assembly containing this class is obsolete.  Reference the ESRI.ArcGIS.ADF.Connection.Local assembly instead.'.

But if befor this changes was only one Warning:
A reference was created to embedded interop assembly 'ESRI.ArcGIS.Carto' because of an indirect reference to that assembly from assembly 'ESRI.ArcGIS.ADF'. Consider changing the 'Embed Interop Types' property on either assembly.

After this changes append second Warning:
A reference was created to embedded interop assembly 'ESRI.ArcGIS.Carto' because of an indirect reference to that assembly from assembly 'ESRI.ArcGIS.ADF.Local'. Consider changing the 'Embed Interop Types' property on either assembly.
0 Kudos
KenBuja
MVP Esteemed Contributor
Did you also remove the reference ESRI.ArcGIS.ADF.ComReleaser?
0 Kudos
AnatolySenchenko
New Contributor
Change the reference to ESRI.ArcGIS.ADF.Connection.Local
There was a recent discussion on here about why the COM releaser isn't a good idea. I've been having good results using Marshal.ReleaseComObject(<your object>) instead.

some more info here:
http://forums.arcgis.com/threads/4298-What-s-Up-with-ComReleaser-Is-it-really-working
http://forums.arcgis.com/threads/75186-Memory-leak-with-FeatureClass-object


If add the reference to ESRI.ArcGIS.ADF.Connection.Local - Nothing has changed!
If replace  ESRI.ArcGIS.ADF to  ESRI.ArcGIS.ADF.Connection.Local - Error:
Type 'ESRI.ArcGIS.ADF.ComReleaser' is not defined.
0 Kudos
AnatolySenchenko
New Contributor
Did you also remove the reference ESRI.ArcGIS.ADF.ComReleaser?

What it means "reference ESRI.ArcGIS.ADF.ComReleaser" ?
I can make reference ESRI.ArcGIS.ADF or ESRI.ArcGIS.ADF.Connection.Local
0 Kudos
KenBuja
MVP Esteemed Contributor
Can you provide a screen shot of the references in your project?

[ATTACH=CONFIG]23915[/ATTACH]
0 Kudos
AnatolySenchenko
New Contributor
Can you provide a screen shot of the references in your project?

[ATTACH=CONFIG]23915[/ATTACH]


reference to ESRI.ArcGIS.ADF.Connection.Local
and
reference ESRI.ArcGIS.ADF

[ATTACH=CONFIG]23916[/ATTACH]
0 Kudos
KenBuja
MVP Esteemed Contributor
I don't see the reference ESRI.ArcGIS.ADF.Connection.Local in your list. Try removing both ESRI.ArcGIS.ADF and ESRI.ArcGIS.ADF.Local and adding in ESRI.ArcGIS.ADF.Connection.Local
0 Kudos