As often a solution to a strange error is so simple when you know it. When I copied my add-ins to a new computer I was not able compile the objects that included DotNet add-ins.
As this happened when I was installing NAV 2013 R2 for the first time my first thought was that this was something that had changed between versions and I sent a support request to Microsoft.
Mohamad Vajid and Duilio Tacconi took the case and tried to reproduce the problem without success. Yesterday we took a look at the problem together and the solution came to our attention.
The Add-in was copied from a web site and because of that the file was blocked by the server operating system.
Then today as I was creating a new website with files that I downloaded from the web I had the same problem. That will be the last time.
After you unblock the file, recheck to see if that worked. If the file is in a protected folder you might need to drag it to your desktop to unblock it and back again.
Thank you Mohamad and Duilio for the assistance.