sqlsharpener icon indicating copy to clipboard operation
sqlsharpener copied to clipboard

Dependancy Issues with Microsoft.Data.Tools.Schema.Sql

Open bsimbeck opened this issue 9 years ago • 6 comments

I was attempting to test this library with generating my EF classes, and when I ran the "Custom Tool" from the content menu of my TT file, I get the following error:

Severity Code Description Project File Line Suppression State Error Running transformation: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Tools.Schema.Sql, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Data.Tools.Schema.Sql, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at Microsoft.SqlServer.Dac.Model.TSqlModel..ctor(SqlServerVersion modelTargetVersion, TSqlModelOptions modelCreationOptions) at SqlSharpener.MetaBuilder.LoadModel() at SqlSharpener.MetaBuilder.get_Tables() at Microsoft.VisualStudio.TextTemplating84159610F57874C491F71FE10F447E99B01EE123BEC660EE937086DB49B427A007E765001AD2BA8136FE03AB1833E02A9B714FE13BA1A2A0ED94B7BDBB97E585.GeneratedTextTransformation.TransformText()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value HKLM\Software\Microsoft\Fusion!EnableLog to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. TestGenerateEF C:\Users\bsimbeck\Documents\GNGV2\Test\TestGenerateEF\TestGenerateEF\TextTemplate1.tt 1

Based on what is generated, it looks like it is happening around the following line of my TT file <# foreach(var tbl in meta.Tables){ #>

I have tried to include the missing DLL library in my solution as well as copy them to the Package folder with the rest of the DLL's it looks like SQLSharpener needs. I have included my solution folder as a zip file for you. TestGenerateEF.zip

bsimbeck avatar Jun 15 '16 19:06 bsimbeck

Do you have SSDT installed?

aeslinger0 avatar Jun 15 '16 20:06 aeslinger0

Yes I do and I reboot, neither seemed to make a difference.

Sent from my iPhone

On Jun 15, 2016, at 4:41 PM, Adam [email protected] wrote:

Do you have SSDT installed?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bsimbeck avatar Jun 15 '16 21:06 bsimbeck

Is there a specific version right now I have 2016.

Sent from my iPhone

On Jun 15, 2016, at 4:41 PM, Adam [email protected] wrote:

Do you have SSDT installed?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

bsimbeck avatar Jun 16 '16 02:06 bsimbeck

This this project dead? Should we hard fork if we have PR's? @aeslinger0

jamesbascle avatar Apr 07 '17 03:04 jamesbascle

I had this problem and determined that it was a version issue. This is what I did to fix this issue:

Copied the Microsoft.Data.Tools.Schema.Sql.dll from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120 and placed that dll in my project.

Modified my T4 to include the following line: <#@ assembly name="$(SolutionDir)\3rd Party Assemblies\Microsoft.Data.Tools.Schema.Sql.dll" #>

chad206548 avatar Jul 14 '17 20:07 chad206548

Hi,

I've been having some problems trying to scafflod views :

I could not find any ways to debug the template, having the same problem with Tools.Schema.SQL ....

Severity Code Description Project File Line Suppression State Error Running transformation: System.InvalidOperationException: Sequence contains no elements at System.Linq.Enumerable.First[TSource](IEnumerable1 source) at SqlSharpener.Model.Column..ctor(TSqlObject tSqlObject, TSqlObject tSqlTable, IEnumerable1 primaryKeys, IDictionary2 foreignKeys) at SqlSharpener.Model.View..ctor(TSqlObject tSqlObject, IEnumerable1 primaryKeys, IDictionary2 foreignKeys) at SqlSharpener.MetaBuilder.<>c__DisplayClass10.<LoadModel>b__9(TSqlObject sqlView) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at SqlSharpener.MetaBuilder.LoadModel(TSqlModel model) at SqlSharpener.MetaBuilder.LoadModel() at SqlSharpener.MetaBuilder.get_Views() at Microsoft.VisualStudio.TextTemplating227143E7CD567DF3423D572AA6919A52675E2DF41D43FC5C1EE7749C5BF314F9A1D27E4C1F83603B866F0B18121DBB56B10F598EAB5FC143EB7D173D5AF72C4F.GeneratedTextTransformation.TransformText() DOLayer C:\Users\cav001\Documents\GitHub\sqlsharpener\examples\SimpleExample\DOLayer\EFCodeFirstExample.tt 1

CarlVerret avatar Dec 05 '18 15:12 CarlVerret