我正在尝试使用 PetaPoco T4 模板(来自 NuGet,版本 4.0.3),但是当我尝试运行模板时出现以下错误:
运行转换:System.ArgumentException:不支持 URI 格式。
在 System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) 在 System.IO.Path.GetFullPathInternal(String path) 在 System.IO.FileInfo.Init(String fileName, Boolean checkHost) 在 System.IO。 FileInfo..ctor(String fileName) 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.GetProjectPath() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.GetConfigPath() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.GetConnectionString(String& connectionStringName, String& providerName) 在Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.InitConnectionString() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.LoadTables() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation。变换文本()
在数据库.tt
我不确定我在这里做错了什么..连接字符串已指定并且已在 Database.tt 中正确设置。除了正确的连接字符串之外,使用此 T4 模板是否还有其他要求?
我的 Database.tt 设置如下所示:
// Settings
ConnectionStringName = "ConnectionString";
Namespace = "TVPPData";
RepoName = "MyContext";
GenerateOperations = true;
GeneratePocos = true;
GenerateCommon = true;
ClassPrefix = "";
ClassSuffix = "";
TrackModifiedColumns = true;
谢谢!