Type Initializer For Fileinfo Doesn't work

Mar 23, 2012 at 3:41 AM


I am using the FileInfo Type Initializer you provide in your documents now. When I execute the workflow, it always throws out "

Execution of the workflow failed. Reason: Create Instance failed for type "system.IO.Fileinfo". NO parameterless constructor  defined for this object."

Could you please help me to solve this problem? I need to finish this workflow by sunday.

Thanks so much!

Mar 23, 2012 at 7:21 AM


Thanks for showing interest in Trident.

The same query has been discussed in this thread http://tridentworkflow.codeplex.com/discussions/237674 . Please let us know if this helps you.

Trident Support Team

Mar 23, 2012 at 3:51 PM

Hi abhisheks,

Thanks. However, I have already read the previous query and I still don't know how to fix the problem.

You mentioned that "So you need to create the Activity with an input parameter which you must provide (i.e. RequiredInput)."

However, I have already did that and the activity still throws out the same exception.

Could you please give me more instructions on that problem?



Quan Zhou

Mar 26, 2012 at 5:12 AM


Working on your query. I will get back to you with the updates soon.

Thanks for patience.

Mar 26, 2012 at 1:16 PM

Quan Zhou,

Could not figured it out where it is getting wrong. Need some more time to analyze. The custom type initializer for Trident mail is working fine and I have tested it. I would suggest  creating a new initializer on the same line. The link for the custom mail initializer is here.

I will get back to you with the details of error next, need some more time.

Trident Support Team


Mar 27, 2012 at 1:45 PM

Hi Quan Zhou,

Any class that does not provide a default constructor cannot be used as a custom type initializer. The FileInfo disscussed in the Trident programming guide need to be modified. If default constructor is removed from the Trident mail initializer it will stop working. As David suggested on the other thread you may use Filepath instead of Fileinfo.

Please let us know if this helps you.

Trident Support Team


Mar 30, 2012 at 2:51 AM

Hi Abhishesks,


Thanks so much for your patience!

For the filepath method, could you give some basic instructions to start on it?


Really appreciate it!

Quan Zhou


Mar 30, 2012 at 8:25 PM

Sure, Quan Zhou. I will modify the sample for file path. I will update you once I finish it and tested, by end of this weekend, along with the the ideas involved.

Happy Weekend!


Apr 2, 2012 at 1:20 PM

Sorry Quan Zhou, could not get the FileInfo sample working as said. My idea to overcome the initial issue was to create a wrapper class over the FileInfo class and update the dependent projects, UnPackData2 and the FileInfoInitializer. But still I am getting the same error message.

The sample codes are here.

It would be great if any community user can show us some light upon this issue with the working code.