2

I am developing a Sharepoint 2013 add-in. Writing the workflow, when using DateTime.today, I get this error: Property access conversion to an activity is not supported for property 'Today' defined on type 'System.DateTime'.

I read online several errors like this one, where people suggest to modify the trusted surface. I did it, but I keep getting the same error.

This is the code I write in the AllowedTypes.xml file:

<AllowedTypes>
  <Assembly Name="mscorlib,  Version=4.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <Namespace Name="System">
    <Type>TimeSpan</Type>
    <Type>DateTime</Type>
  </Namespace>
  </Assembly>

  <Assembly Name="mscorlib,  Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <Namespace Name="System">
    <Type>TimeSpan</Type>
    <Type>DateTime</Type>
  </Namespace>
  </Assembly>
</AllowedTypes>

I am using Visual Studio 2015 on Windows 10. I'll develop the project on Office 365.

How can I solve the problem? Thanks

  • 1
    Have you tried using DateTime.UtcNow ? – user21251 Nov 2 '16 at 15:30
0

As per user21251's comment, by using System.DateTime.UtcNowthe solution builds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.