Type Initializer For Fileinfo Doesn't work

Mar 23, 2012 at 2:41 AM

Hi,

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 6:21 AM

Hi,

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.

Regards,
Trident Support Team

Mar 23, 2012 at 2: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?

Thanks!

 

Quan Zhou

Mar 26, 2012 at 4:12 AM

Hi,

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

Thanks for patience.
Abhishek

Mar 26, 2012 at 12: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.

Thanks,
Trident Support Team

 

Mar 27, 2012 at 12: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.

Regards,
Trident Support Team

 

Mar 30, 2012 at 1: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 7: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!

Abhishek

Apr 2, 2012 at 12: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.


-Regards