VS2010; MySQL和GAC [英] VS2010; MySQL and the GAC

查看:133
本文介绍了VS2010; MySQL和GAC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在装有最新(我认为是6.4.4.4)MySQL的辅助计算机上安装了VS2010.我的代码是在VS2008下使用MySQL 6.3.6.3开发的.

在20个程序集中成功迁移了16个程序集,其中1个带有少量的同轴电缆,另外3个引用了一个共享功能的组件由于GAC对MySQL 6.3.6.3.的引用而坚持存在问题.

我该如何除草呢?

注意MySQL 6.3.6.3在这台机器上不存在,并且我已经从VS2010框上重新创建了有问题的程序集(粘贴了.h和.cpp内容),但是仍然可以看到6.3.6.3.给我上色激怒!

除了下面Mehedi的建议答案之外,
我检查了GAC,并修复了路径.进行了全部重建,没有喜悦.文本搜索在任何地方都找不到对6.3.6的引用,但仍显示在控制台编译器中:

I have installed VS2010 on a secondary machine with the latest (I think 6.4.4.4) MySQL. My code was developed under VS2008 with MySQL 6.3.6.3

16 of 20 assemblies migrated successfully, 1 with a little coaxing, and three others that reference a common shared function insist on having a problem due to a GAC reference to MySQL 6.3.6.3.

How do I weed this out?

Note MySQL 6.3.6.3 never existed on this machine, and I have re created the offending assemblies from nothing on the VS2010 box (pasting in the .h and .cpp contents), but it can still see 6.3.6.3. Colour me exasperated!

Further to Mehedi''s suggested anwser below
I checked th GAC, and fixed the paths. Did a rebuild all and no joy. A text search finds no reference to 6.3.6 anywhere, but it is still showing up in the console compile:

1>------ Build started: Project: VT_Console, Configuration: Debug Win32 ------
1>Build started 24/02/2012 05:44:25.
1>ResolveAssemblyReferences:
1>  Consider app.config remapping of assembly "MySql.Data, Culture=neutral, PublicKeyToken=c5687fc88969c44d" from Version "6.3.6.0" [] to Version "6.4.4.0" [C:\Program Files (x86)\MySQL\Connector NET 6.4.4\Assemblies\v4.0\MySql.Data.dll] to solve conflict and get rid of warning.
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(1490,5): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
1>InitializeBuildStatus:
1>  Creating "Debug\VT_Console.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>GenerateTargetFrameworkMonikerAttribute:
1>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
1>ClCompile:
1>  All outputs are up-to-date.
1>  All outputs are up-to-date.
1>  All outputs are up-to-date.
1>CoreResGen:
1>  Processing resource file "Form1.resX" into "Debug\VT_Console.Form1.resources".
1>ResourceCompile:
1>  All outputs are up-to-date.
1>Link:
1>  VT_Console.vcxproj -> C:\SBSB\systems\debug\VT_Console.exe
1>PostBuildEvent:
1>          1 file(s) copied.
1>FinalizeBuildStatus:
1>  Deleting file "Debug\VT_Console.unsuccessfulbuild".
1>  Touching "Debug\VT_Console.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:05.77
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========



这是app.config:



This is app.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="SQLConnection"
    connectionString="Server=localhost;
                      user id=root;
                      password=ghxxxxxx;
                      persist security info=True;
                      database=vendatic"
    providerName="System.Data.SqlClient" />
  </connectionStrings>
  <!--For COM Interfacing-->
  <!--ComConnection User="root" Password="ghxxxxxx" Host="localhost" database="vendatic" /-->
  <!-- Consider removing from released version-->
  <!--system.windows.forms jitDebugging="true" /-->
</configuration>



将以下内容添加到app.config中没有区别:



Adding the following to app.config made no differance:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" />
      <bindingRedirect oldVersion="6.3.6.0"
      newVersion="6.4.4.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>



我暂时不会解决这个问题,但是在现阶段,我已经在VS2005的预发布日中找到了对此行为的在线参考,在VS2005中它被认为是一个错误!作为一种解决方法,我将6.3.6与6.4.4并排放置在计算机上,这很丑陋,但它使我解决了这个问题.



I am going to leave this unsolved for now, but at this stage, I have found reference online to this behaviour in the pre release days of VS2005 where it was acknowledged as a bug! As a workaround I put 6.3.6 on the machine alongside 6.4.4 - ugly but it gets me passed the problem

推荐答案

请执行以下操作:

1)清除GAC中与您项目相关的所有内容.
2)逐个打开您的项目(.xxproj文件),如果未修复路径,请检查HintPath指向有效路径.
3)重建您的项目
Do the following:

1) Clear the GAC of everything related to your projects.
2) Open your projects one by one (the .xxproj file) and check the HintPath points to a valid path if not fix the paths.
3) Rebuild your projects


这篇关于VS2010; MySQL和GAC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆