0

我正在尝试在 Visual Studio 2012 中使用 SubSonic 3.0.0.4 T4 模板,但在尝试运行自定义工具时出现错误:

Running transformation: System.ArgumentException: URI formats are not supported.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
at System.IO.FileInfo..ctor(String fileName)
at Microsoft.VisualStudio.TextTemplatingDEA67E4EB0C1122C647D57B24990E6ADC926293FAA416AB931D00586F4B18B19835EBCF363314E3900B217C8CCCCBA2FE49FB073A2A661FD3E6B140615356056.GeneratedTextTransformation.GetProjectPath()
at Microsoft.VisualStudio.TextTemplatingDEA67E4EB0C1122C647D57B24990E6ADC926293FAA416AB931D00586F4B18B19835EBCF363314E3900B217C8CCCCBA2FE49FB073A2A661FD3E6B140615356056.GeneratedTextTransformation.GetConfigPath()
at Microsoft.VisualStudio.TextTemplatingDEA67E4EB0C1122C647D57B24990E6ADC926293FAA416AB931D00586F4B18B19835EBCF363314E3900B217C8CCCCBA2FE49FB073A2A661FD3E6B140615356056.GeneratedTextTransformation.GetConnectionString(String connectionStringName)
at Microsoft.VisualStudio.TextTemplatingDEA67E4EB0C1122C647D57B24990E6ADC926293FAA416AB931D00586F4B18B19835EBCF363314E3900B217C8CCCCBA2FE49FB073A2A661FD3E6B140615356056.GeneratedTextTransformation.get_ConnectionString()
at Microsoft.VisualStudio.TextTemplatingDEA67E4EB0C1122C647D57B24990E6ADC926293FAA416AB931D00586F4B18B19835EBCF363314E3900B217C8CCCCBA2FE49FB073A2A661FD3E6B140615356056.GeneratedTextTransformation.GetReader(String sql)
at Microsoft.VisualStudio.TextTemplatingDEA67E4EB0C1122C647D57B24990E6ADC926293FAA416AB931D00586F4B18B19835EBCF363314E3900B217C8CCCCBA2FE49FB073A2A661FD3E6B140615356056.GeneratedTextTransformation.LoadTables()
at Microsoft.VisualStudio.TextTemplatingDEA67E4EB0C1122C647D57B24990E6ADC926293FAA416AB931D00586F4B18B19835EBCF363314E3900B217C8CCCCBA2FE49FB073A2A661FD3E6B140615356056.GeneratedTextTransformation.TransformText()    C:\SourceControl\Web Projects\XXX\xxx\App_Code\DAL\Classes.tt   1   1   http://localhost/XXX/

通常,我一直在使用带有 Web 应用程序的 VS2010,并使用内置的 Web 服务器运行它们。该项目托管在我的本地 IIS 实例上(不确定是否有所作为)。

任何帮助,将不胜感激。

4

1 回答 1

0

I'm running 2012 and have no problems generating SubSonic-code through Run Custom Tool so must be something related to your project's configuration. Error message suggests something with ProjectPath - most likely when the T4 code is trying to find and pick up the connection string.

于 2012-11-14T09:24:20.323 回答