How to set “Specific Version” property for project references in Visual Studio

前端 未结 4 1206
旧时难觅i
旧时难觅i 2021-01-18 06:04

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 ass

相关标签:
4条回答
  • 2021-01-18 06:40

    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.

    0 讨论(0)
  • 2021-01-18 06:42

    You can add references to project output dlls instead of projects. Then you will be able to set Specific Version setting.

    0 讨论(0)
  • 2021-01-18 06:55

    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):

    • Have the project you want to reference in your solution, just like you do now with the project reference
    • Explicitly set the dependency chain so the 'referenced' project is built first
    • Build the referenced project A once first manually
    • Create an assembly reference in project B to the results from the build in project A
    • Set the assembly reference to 'Specific Version = false'

    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)

    0 讨论(0)
  • 2021-01-18 07:04

    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.

    0 讨论(0)
提交回复
热议问题