How to link multiple visual studio solutions together?

前端 未结 9 1386
南笙
南笙 2021-02-01 01:28

I have 3 solutions and solution A requires built versions of the dlls from solution B and C in order to compile. it is not possible to merge it to one solution...

So far

相关标签:
9条回答
  • 2021-02-01 02:12

    I have recently discovered that in Visual Studio 2008 you can include existing projects in multiple solutions. The only downside so far seems to be that if you make a change to a shared project and have multiple solutions open that use that shared project you will be asked to "reload" the other solutions.

    So, just "Add Existing Project" to all the solutions that need the project. I am using TFS on my current site and there seems to be no issues with source control ether.

    0 讨论(0)
  • 2021-02-01 02:12

    I fixed the issue by putting the script in the pre-build event command line and if project A is failed to build throw msg alert

    ECHO "build A project"
    set AppMsg ="%SystemRoot%\System32\msg.exe"
    set AppMsg
    if not "%ProgramFiles(x86)%" == "" (
    if exist "%SystemRoot%\Sysnative\*" set AppMsg="%SystemRoot%\Sysnative\msg.exe"
    )
    set AppMsg
    taskkill /f /im "%PROGRAMFILES(X86)%\MSBuild\14.0\Bin\msbuild" "$(SolutionPath)" /t:Project_A_Name /p:Configuration=Debug;TargetFrameworkVersion=v4.5 /p:Platform="Any CPU" /p:BuildProjectReferences=false /p:VSToolsPath="%PROGRAMFILES(X86)%\MSBuild\Microsoft\VisualStudio\v14.0" 2>nul 1>nul
    echo ERRORLEVEL %ERRORLEVEL%
    if ERRORLEVEL 1 (
    ECHO "failed to build test project"
    %AppMsg% * "failed to build test project"
    )
    exit 0
    
    0 讨论(0)
  • 2021-02-01 02:14

    You could try to add command line build commands for the dll (in solution B and C) you depend on in the prebuild events of your projects (in solution A)

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