Showing results for 
Search instead for 
Did you mean: 

Re: Retrieve file properties

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom



it's not working, because the [STAThread] attribute decoration of your Main function is still missing. See correction here:


namespace ConsoleApp1
    class Program
        static void Main(string[] args)
            SolidEdgeFileProperties.PropertySets propertySets = new SolidEdgeFileProperties.PropertySets();
            SolidEdgeFileProperties.Properties properties = null;
            propertySets.Open("path to an assembly");
            properties = (SolidEdgeFileProperties.Properties)propertySets[0];            
            var descriptionProperty = (SolidEdgeFileProperties.Property)properties.get_PropertyByID(2);
            var description = descriptionProperty.Value.ToString();

And also ensure to use x64 configuration instead of AnyCPU. Then your code above will work (just verified).

The exception can't be caught by try-catch, because it's a severe .NET runtime exception.

Kind regards,
Wolfgang Kunert -

Re: Retrieve file properties


You're right.


I had already tried with the [STAThread] but not the x64.


The problem in the real application was that this code was in a library I did change the platform in the executable project but not in the library.


Thanks a lot