Access to the path '<>\Company.Project.Web\T4MVC.tt' is denied.
description
- Including a Fix that solves this issue.
I have added my solution to TFS, which has the habit of setting files to readonly. This causes Chirpy to shriek and die with the following last tweet:
---------------------------
System.UnauthorizedAccessException: Access to the path 'S:\Mvc\Sarens.Kracom.Mvc\Sarens.Kracom.Web\T4MVC.tt' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at Microsoft.VisualStudio.Text.Implementation.TextDocument.PerformSave(FileMode fileMode, String filePath, Boolean createFolder)
at Microsoft.VisualStudio.Text.Implementation.TextDocument.Save()
at Microsoft.VisualStudio.Editor.Implementation.VsDocDataAdapter.<Save>b__a()
at Microsoft.VisualStudio.Editor.Implementation.VsDocDataAdapter.Save(Action saver)
at Microsoft.VisualStudio.Editor.Implementation.VsDocDataAdapter.Save(String pszFilename, Int32 fRemember, UInt32 nFormatIndex)
at EnvDTE.ProjectItem.Save(String FileName)
at Zippy.Chirp.Engines.T4Engine.RunT4Template(DTE2 app, String t4TemplateList)
---------------------------
I took a look at the sourcecode and figure you can change the RunT4Template method (in \Engines\T4Engine.cs)
See the second solution, the first (which I removed here) did not quite work.