Error The type 'ESRI.ArcGIS.Geometry.SpatialReferenceEnvironmentClass' has no constru

4902
5
Jump to solution
03-12-2012 05:33 AM
ShaningYu
Frequent Contributor
I updated a .Net project from FW 3.5 to 4.0 (change the .Net FW target), I received a dozen of errors about No Constructors defined.  One of them is below:
Error  The type 'ESRI.ArcGIS.Geometry.SpatialReferenceEnvironmentClass' has no constructors defined
What should I do to solve this problem?  Thanks.
0 Kudos
1 Solution

Accepted Solutions
NeilClemmons
Regular Contributor III
You can do that if you want but I've run into problems trying to use the 4.0 Framework with ArcObjects.  The majority of our code is still at 9.3.1 but if you're using 10.0 you may not run into the same problems.

View solution in original post

0 Kudos
5 Replies
NeilClemmons
Regular Contributor III
The .NET Framework 4.0 is not currently supported.  You'll have to change the target framework back to 3.5.
0 Kudos
ShaningYu
Frequent Contributor
Use the approach posted at:
http://gis.stackexchange.com/questions/5782/no-constructor-defined
1)  In your project references, find the assembly where FeatureClassNameClass is (ie ESRI.ArcGIS.Geodatabase).
2)  Right-click it and select "properties"
3)  Change "Embed interop types" to "false"
The No-Constructor problem is gone.
BarbaraSchneider1
New Contributor III

Thanks, this is what I was looking for

0 Kudos
NeilClemmons
Regular Contributor III
You can do that if you want but I've run into problems trying to use the 4.0 Framework with ArcObjects.  The majority of our code is still at 9.3.1 but if you're using 10.0 you may not run into the same problems.
0 Kudos
ShaningYu
Frequent Contributor
Neil:
Thanks for your response.  Actually, the problem I got is that posted at
http://forums.arcgis.com/threads/52656-Error-HRESULT-E_FAIL-has-been-returned-from-a-call-to-a-COM-c......
Then I tried to change the FW from 3.5 to 4.0.  The No-Constructor problem appears to be gone (see my continued thread).  But the avobe error (HRESULT-E_FAIL) still exists.  Thanks.
Shaning
0 Kudos