mysqlsugar 为. MySql.Data.dll加载不到 返回

SqlSugar 老数据
15 4869

mysqlsugar 为. MySql.Data.dll加载不到

热忱回答(15)

  • 最好具体一点哪儿加载不到。

    0 回复
  • 蓝の衫 蓝の衫 VIP0
    2016/12/15

    严重性 代码 说明 项目 文件 行 禁止显示状态

    错误 尝试编译转换代码时引发了异常。 引发了以下异常: 

    System.IO.FileNotFoundException: 未能找到路径“C:\Users\carson\Desktop\MySqlSugar-master\lib\MySql.Data.dll”的一部分。

    文件名:“C:\Users\carson\Desktop\MySqlSugar-master\lib\MySql.Data.dll” ---> System.IO.DirectoryNotFoundException: 未能找到路径“C:\Users\carson\Desktop\MySqlSugar-master\lib\MySql.Data.dll”的一部分。

       在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

       在 System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)

       在 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)

       在 System.IO.File.OpenRead(String path)

       在 Roslyn.Utilities.FileUtilities.OpenFileStream(String path)

       在 Roslyn.Utilities.FileUtilities.OpenFileStream(String path)

       在 Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)

       在 Microsoft.VisualStudio.TextTemplating.CompilerBridge.<>c.<.ctor>b__15_0(String x)

       在 System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()

       在 System.Linq.Enumerable.<UnionIterator>d__66`1.MoveNext()

       在 System.Linq.Enumerable.<UnionIterator>d__66`1.MoveNext()

       在 System.Linq.Buffer`1..ctor(IEnumerable`1 source)

       在 System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)

       在 System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)

       在 Microsoft.CodeAnalysis.ImmutableArrayExtensions.AsImmutableOrEmpty[T](IEnumerable`1 items)

       在 Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable`1 references)

       在 Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable`1 references)

       在 Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonWithReferences(IEnumerable`1 newReferences)

       在 Microsoft.VisualStudio.TextTemplating.CompilerBridge.PrepareNewCompilation()

       在 Microsoft.VisualStudio.TextTemplating.CompilerBridge.Compile()

       在 Microsoft.VisualStudio.TextTemplating.TransformationRunner.Compile(String source, String inputFile, IEnumerable`1 references, Boolean debug, SupportedLanguage language, String compilerOptions) 1


    0 回复
  • @蓝の衫:MYSQL.DATA从NUGET下载一个就可以了

    0 回复
  • 不要用GITHUB上的DLL

    0 回复
  • 蓝の衫 蓝の衫 VIP0
    2016/12/15

    blob.pngblob.png

    dll肯定有的

    0 回复
  • 蓝の衫 蓝の衫 VIP0
    2016/12/15

    我重新下载过dll好像也没有用

    0 回复
  • 蓝の衫 蓝の衫 VIP0
    2016/12/15

    @fate stay night:我重新下载过dll好像也没有用

    0 回复
  • @蓝の衫:用BIN目录生成出来的DLL 并且T4是新建的

    0 回复
  • <#@ template debug="false" hostspecific="true" language="C#" #>

    <#@ import namespace="System.Collections.Generic" #>

    <#@ assembly name="System.Core" #>

    <#@ assembly name="System.Xml" #>

    <#@ assembly name="System.Xml.Linq" #>

    <#@ assembly name="System.Data" #>

    <#@ import namespace="System.Linq" #>

    <#@ import namespace="System.Text" #>

    <#@ import namespace="System.Collections.Generic" #>

    <#@ import namespace="MySqlSugar" #>

    <#@ import namespace="System.IO" #>

    <#@ import namespace="System.Web" #>

    <#@ assembly name="F:\MyOpenSource\MySql\Demos\bin\Debug\MySql.Data.dll" #>

    <#@ assembly name="F:\MyOpenSource\MySql\Demos\bin\Debug\MySqlSugar.dll" #>


    <# 

         

    //CTRL+S将会执行该文件的代码,自动作生实体

        //当前项目目录

        string projectDir = Host.ResolveAssemblyReference("$(ProjectDir)");


    //解决方案目录

        string solutionDir = Host.ResolveAssemblyReference("$(SolutionDir)");


     

    using (var db = new SqlSugarClient("server=localhost;Database=SqlSugarTest;Uid=root;Pwd=root"))

         {

              db.ClassGenerating.CreateClassFiles(db, projectDir +"/Models","Models");  


          };

    #>


    0 回复
  • 经测试是OK的

    0 回复
  • 蓝の衫 蓝の衫 VIP0
    2016/12/15

    @fate stay night:T4那里可以不用<#@ assembly name="F:\MyOpenSource\MySql\Demos\bin\Debug\MySql.Data.dll" #>因为mysqlsugar本身已经有驱动了。

    你loading了这个驱动,你也没有using呀

    0 回复
  • 蓝の衫 蓝の衫 VIP0
    2016/12/15

    @fate stay night:我的也可以了,忘记结贴了,给个结贴功能哈~

    0 回复
  • 蓝の衫 蓝の衫 VIP0
    2016/12/15

    @fate stay night:然后搞个结贴的栏目,是bug或问题被解决的栏目

    0 回复
  • 没听懂只要你可以用就行了

    0 回复
  • 嗯会加的你可以把你t4分享一下

    0 回复