简体   繁体   English

如何发布具有两个依赖项项目的Visual Studio解决方案?

[英]How to a publish visual studio solution with two dependencies projects to azure?

In Visual studio 2013 I have MVC solution with two projects: project 1 project 2 在Visual Studio 2013中,我有两个项目的MVC解决方案:项目1项目2

project 1 depends on project 2 项目1取决于项目2

It works fine in my local machine but I get error when I deployed to Azure: 它在我的本地计算机上运行良好,但是在部署到Azure时出现错误:

Could not load file or assembly 'MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.

My question: did I have to deploy both projects separately to azure or just deploy the main project? 我的问题是:我是否必须将两个项目分别部署以使天蓝色或仅部署主项目?

It should work automatically but beware of any libraries you have registered in the GAC on your PC since they will automatically link to the GAC version and "Copy Local" in the properties will be set to false. 它应该可以自动运行,但是请注意您在PC上的GAC中注册的所有库,因为它们会自动链接到GAC版本,并且属性中的“本地复制”将设置为false。 You can change this to true and force it to put a copy in the bin folder so that it copies correctly. 您可以将其更改为true并强制其将副本放入bin文件夹中,以便正确复制。

You only need to do this on the project that directly references the file. 您只需要在直接引用该文件的项目上执行此操作。 If project2 references project1, it will copy all output dlls across to bin automatically. 如果project2引用project1,它将自动将所有输出dll复制到bin中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM