T4MVC Error - T4 file is blocked or in a non trusted zone

jdavis picture jdavis · Nov 3, 2012 · Viewed 10.7k times · Source

I am running Visual Studio 2010 on a Windows 7 virtual machine inside of Parallels Desktop 8 on a Mac Book Pro.

I'm trying to incorporate T4MVC into a new MVC4 project. I installed the T4MVC package from Nuget and immediately started getting this error...

Failed to resolve include text for file:The path '\psf\Home...\T4MVC.tt.hooks.t4' must be either local to this computer or part of your trusted zone. If you have downloaded this template, you may need to 'Unblock' it using the properties page for the template file in Windows Explorer.

I went into the "Properties" menu for the T4MVC.tt.hooks.t4 file, but I could not find any option or button to unblock it.

My assumption is that this problem has something to do with the fact that I'm running on a virtual machine and therefore My project files are not in a trusted location. But I'm not sure how to fix that.

I've been searching around but can't seem to find any answers. Any help would be appreciated.

Thanks

Answer

Sevin7 picture Sevin7 · Apr 19, 2014

This works for me with VS2012:

Using Internet Explorer:

Go to Tools | Internet Options and click the Security tab Under Trusted Sites, click Sites and uncheck “Require https…” Finally add a new entry – it should be the location of your shared folder: “file://folder_name” – note we’re using file instead of https.