nopcommerce needs to be hosted in a full trust environment for this feaure to work - contact your hosting company and ask them to change your application folder to full trust
as an alternative, there was a post on the forum recently with instructions on how to make the invoice work on medium trust