Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 4.0 尝试使用PetaPoco T4模板时出错_C# 4.0_Orm_T4_Petapoco - Fatal编程技术网

C# 4.0 尝试使用PetaPoco T4模板时出错

C# 4.0 尝试使用PetaPoco T4模板时出错,c#-4.0,orm,t4,petapoco,C# 4.0,Orm,T4,Petapoco,我试图使用PetaPoco T4模板(来自NuGet,版本4.0.3),但当我尝试运行该模板时,出现以下错误: 正在运行转换:System.ArgumentException:URI格式不可用 支持。 在System.IO.Path.NormalizePath(字符串路径,布尔值 完全检查,Int32 maxPathLength)在 System.IO.Path.GetFullPathInternal(字符串路径)位于 System.IO.FileInfo.Init(字符串文件名,布尔check

我试图使用PetaPoco T4模板(来自NuGet,版本4.0.3),但当我尝试运行该模板时,出现以下错误:

正在运行转换:System.ArgumentException:URI格式不可用 支持。
在System.IO.Path.NormalizePath(字符串路径,布尔值 完全检查,Int32 maxPathLength)在 System.IO.Path.GetFullPathInternal(字符串路径)位于 System.IO.FileInfo.Init(字符串文件名,布尔checkHost)位于 System.IO.FileInfo..ctor(字符串文件名)位于 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.GetProjectPath() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.GetConfigPath() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.GetConnectionString(字符串& connectionStringName、String和providerName)位于 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.InitConnectionString() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.LoadTables() 在 Microsoft.VisualStudio.TextTemplating.GeneratedTextTransformation.TransformText()

在Database.tt中

我不确定我做错了什么。。已指定连接字符串,并且已在Database.tt中正确设置。除了正确的连接字符串外,是否还有其他一些使用T4模板的要求

My Database.tt设置如下所示:

// Settings
ConnectionStringName = "ConnectionString";
Namespace = "TVPPData";
RepoName = "MyContext";
GenerateOperations = true;
GeneratePocos = true;
GenerateCommon = true;
ClassPrefix = "";
ClassSuffix = "";
TrackModifiedColumns = true;

谢谢

我自己也弄明白了:

事实证明,Petapoco T4模板不适用于使用URL或IIS条目添加到解决方案中的网站项目。我现在将该项目重新添加为文件系统项目,现在它运行良好