2013-10-25 30 views
1

所以usgin給定的T4文件https://github.com/ServiceStack/ServiceStack.OrmLite/tree/master/src/T4服務棧創建POCO

我不能讓它工作,我得到這個錯誤:我看到的是,它調用的32位版本,但我的問題使用64位版本我搜索和嘗試posible解決方案,並沒有爲我工作posible解決方案是(PlatformTarget AnyCPU),但仍然無法正常工作。有任何想法嗎?使用

Error 1 Assembly Load Problem The following exception occurred :'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' Se produjo la siguiente excepción: System.BadImageFormatException: No se puede cargar el archivo o ensamblado 'file:///C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' ni una de sus dependencias. Se ha intentado cargar un programa con un formato incorrecto. Nombre de archivo: 'file:///C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' en System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) en System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) en System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) en System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) en System.Reflection.Assembly.LoadFrom(String assemblyFile) en Microsoft.VisualStudio.TextTemplating.TransformationRunner.AttemptAssemblyLoad(String assemblyName)

WRN: Assembly binding logging is disabled . To enable logging assembly bind failure , set the registry value [ HKLM \ Software \ Microsoft \ Fusion! EnableLog ] (DWORD) to 1. Note : There is some performance penalty associated error log Assembly binding . To turn this feature off , remove the registry value [ HKLM \ Software \ Microsoft \ Fusion! EnableLog ] .

vs2012在Windows 8

+0

OrmLite T4模板我很好地工作在VS2012/Windows 8的您能幫你設置一些更多的信息 - 什麼是您的連接字符串? – ngm

+0

<! - - > –

回答

1

Blockquote

這裏是我的步驟,使其工作:

  • 在Visual Studio中的一個新的控制檯應用程序2013

  • 將您的「ConnectionString添加到您的App.config中

  • 在的NuGet控制檯:安裝-包裝ServiceStack.OrmLite.SqlServer

  • 在的NuGet控制檯:安裝-封裝ServiceStack.OrmLite.T4(忽略錯誤)

  • 除去頂部的空行和所有.tt文件的底部文件 OrmLite.Core.ttinclude OrmLite.Poco.tt OrmLite.SP.tt

  • 編譯您的項目。

Blockquote