Select to view content in your preferred language

No Constructors Defined???

4350
4
01-12-2011 09:09 AM
JoshV
by
Regular Contributor
Hello-

I had written a rather long C# standalone console app that worked fine on a Windows XP machine running ArcGIS 9.3.1.  I copied this over to a Windows 2008 Server that is running ArcGIS 10 (along with Visual Studio 2010) and every single place I have the "new" keyword I'm getting a "Has No constructors defined error.."  See example below.  What can I do to fix this??  many thanks

 ESRI.ArcGIS.esriSystem.IPropertySet pInPropSet;
           pInPropSet = new PropertySetClass();  //The error is highlighting new PropertySetClass()
0 Kudos
4 Replies
AlexanderGray
Honored Contributor
Have you updated all the project references to be version independent and to replace some of the changed ones to the ArcGIS 10 references?  I notice you use the full namespace reference to the library in interface name for the declaration but not for the class name in the constructor, did you declare using on the namespace for the class, are there warnings on these using statements?
0 Kudos
JoshV
by
Regular Contributor
Have you updated all the project references to be version independent and to replace some of the changed ones to the ArcGIS 10 references?  I notice you use the full namespace reference to the library in interface name for the declaration but not for the class name in the constructor, did you declare using on the namespace for the class, are there warnings on these using statements?


Hi Alexander-

All I have really done once I copied over the C# project was to remove all references and then re added them back thinking that would fix the problem.  I also added a reference to ESRI.ArcGIS.Version.  So can you explain a few steps about what you mean?  Many thanks Alexander..
0 Kudos
JeffreyHamblin
Occasional Contributor
I think what Alexander is driving at is you either need to add a using statement, or fully qualify your constructor:
// either:
using ESRI.ArcGIS.esriSystem;

IPropertySet pInPropSet;
pInPropSet = new PropertySetClass();

// or:
ESRI.ArcGIS.esriSystem.IPropertySet pInPropSet;
pInPropSet = new ESRI.ArcGIS.esriSystem.PropertySetClass();


-Jeff
0 Kudos
JoshV
by
Regular Contributor
Thank you both Alexander and Jeff.  I think you got me going on the right track.
0 Kudos