我的 Visual Studio 2012 Professional 在使用三项目解决方案时遇到问题。 我整天都在努力处理 LinqToMySQL.edmx 文件,并让 MySQL 数据连接选项出现在服务器资源管理器中。 为此,我尝试安装 EFTools6.1.0ForVS2012。我试过的mysql连接器是mysql-connector-net-6.7.4。这在某一点上有效,但 MySQL dll 版本的其他问题意味着我回到原点(当我从 nuGet 6.8.3 获得最新版本的 DLL 时,它仍在寻找 6.7.4)。从那以后我得到了 6.7.4 并为所有项目添加了对 dll 的引用。我也试过编辑 machine.config 来寻找正确的 mysql 数据提供者。仍然没有快乐。
但是现在...
对于每个解决方案,在尝试访问“属性”>“设置”时无法读取 app.config 或 web.config 文件。
An error occurred while reading the app.config file. The file might be corrupted or contain invalid XML
在 XML 验证器下检查时,所有文件似乎都是有效的。
在 VS2012 中打开项目时出现错误:
Microsoft Visual Studio The ProviderPackage package did not load correctly. The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file t:\Users\John\AppData\Roaming\Microsoft\VisualStudio\11.0\A ctivityLog.xml.
当尝试创建一个新项目时,我得到:
Failed to create a 'ImageSource' from the text '..\lmages\Medium.png'.
重新安装 Visual Studio 后问题仍然存在。 在事件日志中,最后的错误是:
<entry>
<record>235</record>
<time>2014/03/25 10:28:31.202</time>
<type>Warning</type>
<source>Microsoft.VisualStudio.CommonIDE.ExtensibilityHosting.VsShellComponentModelHost</source>
<description>The catalog cache file is not up-to-date and has to be regenerated:</description>
<path>C:\Users\John\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache\Microsoft.VisualStudio.Default.cache</path>
</entry>
<entry>
<record>236</record>
<time>2014/03/25 10:28:31.211</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual Studio Component Model Host Package]</description>
<guid>{49D12072-378B-4FFA-A09E-40E0B5D097CC}</guid>
<hr>80131902</hr>
<errorinfo>Configuration system failed to initialize</errorinfo>
</entry>
<entry>
<record>237</record>
<time>2014/03/25 10:28:31.241</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual Studio Component Model Host Package]</description>
<guid>{49D12072-378B-4FFA-A09E-40E0B5D097CC}</guid>
<hr>80131902</hr>
<errorinfo>Configuration system failed to initialize</errorinfo>
</entry>
最佳答案
看起来这些错误中的大部分是由框架文件夹中的 machine.config 文件中格式错误的 XML 引起的。 framework64 中的 machine.config 文件很好,这一定让我感到困惑。这就是使用记事本进行编辑的好处! mysql 连接器仍有问题,但这是一个单独的问题。
关于mysql - Visual Studio 设置文件损坏/MySQL 连接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22616297/