Creating a codedUI Test Project I get an Access is denied error-Collection of common programming errors

I am trying to use coded UI test in Visual Studio 2012. When I try to make a Coded UI test Project or try to add a coded UI test To an existing project I get :

An unexpected error happened and Coded UI Test can not recover from it.

Exception Message : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Source Assembly: mscorlib.dll

If I create a coded UI test in VS2010 then move open it in VS2012 I get the same Access is denied error. (It does run properly in 2010).

Checking the event viewer I get same exception:

The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event: (devenv.exe, PID 5528, Thread 1) TestProjectWizard.RunFinished: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))    at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)    at System.Reflection.Assembly.LoadFile(String path)    at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager.LoadAssembly(String assemblyFile)    at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager.LoadAssemblies(String[] assemblyNames)    at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager..ctor()    at Microsoft.VisualStudio.TestTools.UITest.Framework.UITestService.Initialize()    at Microsoft.VisualStudio.TestTools.UITesting.PropertyProviderManager.get_Instance()    at Microsoft.VisualStudio.TestTools.CodedUITest.UITestWizardBase.ProjectItemFinishedGenerating(ProjectItem projectItem)    at Microsoft.VisualStudio.TemplateWizard.Wizard.EnumContentsAddItem(ProjectItems projectItems, XmlNode contentNode, String projectName, String currentFolder, String currentTargetFolder, String rootName, String templateFolderPath, String destinationRootFolderPath, String userSpecifiedDestItemPath, String projectTypeString, List`1 wizardExtensions, String rootExtension)    at Microsoft.VisualStudio.TemplateWizard.Wizard.Execute(Object application, Int32 hwndOwner, Object[]& ContextParams, Object[]& CustomParams, wizardResult& retval)    at EnvDTE80.IVsExtensibility2.RunWizardFileEx(String bstrWizFilename, Int32 hwndOwner, Object[]& vContextParams, Object[]& vCustomParams)    at Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TestProjectService.AddTestFromTemplate(ProjectItems projectItems, String templateFile, String newItemName, Object[] customParams)    at Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TestProjectService.AddTestToProject(Project testProject, ProjectItem folder, String templateId, String testName, Object[] customParams)    at Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TestProjectService.AddTestToProject(Project testProject, String templateId, Object[] customParams)    at Microsoft.VisualStudio.TestTools.TestProjectWizards.WizardHelper.AddTests(IServiceProvider serviceProvider, Project project, String[] templateIds)    at Microsoft.VisualStudio.TestTools.TestProjectWizards.TestProjectWizardExtension.RunFinished()

the message resource is present but the message is not found in the string/message table

I am guessing that I am missing permissions on something but I can’t figure out what.