如何设置“特定版本” Visual Studio 中项目引用的属性
我有一个包含多个项目的 Visual Studio 解决方案,并将项目之间的引用设置为项目引用。
添加对程序集的引用后,引用的属性包含
特定版本 = True|False
的设置,项目引用缺少此属性。 怎么设置呢? 我希望我的解决方案能够加载 bin 文件夹中的任何可用程序集(无论什么版本)。
当工作流实例(Workflow Foundation)被反序列化并且同时更新依赖项时,我遇到了问题。
I have got a Visual Studio Solution containing several projects and have set up the references between the projects as project references.
When a reference to an assembly is added, the references' properties contain a setting for
Specific Version = True|False
This property is missing for project references. How can it be set? I'd like my solution to load any available assembly (no matter what version) in the bin folder.
I've had a problem when a workflow instance (Workflow Foundation) was deserialized and the dependencies were updated meanwhile.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为问题在于,您所要求的内容不可能直接通过项目引用来实现,我认为由于链接的性质,它总是隐式地变成“显式版本”。
您可以执行此操作的方式(调用当前引用的项目 A 和引用的项目 B):
构建顺序(依赖)将保证 A 始终在 B 之前构建,并且 B 将从 A 的二进制输出目录中引用它。
(不过,它有点脆弱,我不会推荐它,因为如果设置是很容易得到错误的结果)不太好,或者太阳与星星的排列错误,或者诸如此类的)
I think the problem is that what you are asking is not possible directly with a project reference, I think that always implicitly turns into an 'explicit version', because of the nature of the link.
The way you could do this (calling the currently referenced project A, and the referencing project B):
The build order (dependency) will guarantee that A is always built before B, and B will reference it from the binary output directory of A.
(altho, it's a little brittle and I would not recommend it since it's easy to get wrong results if the settings are not all right, or the sun aligns with the stars wrong, or some such)
我可能会误解您的问题,但是当您添加项目引用时,项目的程序集始终会加载到构建项目时引用它的任何项目中。 因此,您将始终在该项目的 bin 文件夹中拥有最新的可用程序集。 在这方面,VS 对待项目的方式与其他程序集不同。
I might be misunderstanding your question, but when you add a project reference, the project's assembly is always loaded into any project that references it when the project is built. Therefore, you'll always have the latest available assembly in the bin folder for that project. VS treats projects differently than other assemblies in that regard.
您可以添加对项目输出 dll 而不是项目的引用。 然后您将能够设置特定版本设置。
You can add references to project output dlls instead of projects. Then you will be able to set Specific Version setting.
我已经找到了解决我的问题的方法。 此处描述得非常详细。
问题不是错误的项目引用问题,而是工作流实例的反/序列化问题。
感谢所有试图提供帮助的人。
I have found the solution to my problem. It's described pretty detailed here.
The problem is not a matter of wrong project references, but more a de/serializing of workflow instances question.
Thanks to everybody who tried to help.