Does this work for command line builds as well?

Issue #25 resolved
Former user created an issue

Is there any info on that?.. I assume it won't work as it uses VS apis but it would be nice to say so somewhere upfront because then I have to create another solution for the CI server.

Comments (8)

  1. Denis Kuzmin repo owner
    • changed status to open

    Question already asked in Q/A

    It's probably maybe work, let me explain...

    All extensions can be loaded with Microsoft.VisualStudio.Shell.ProvideAutoLoadAttribute

    for example, vsSBE loaded as:

    //  To be automatically loaded when a specified UI context is active
    [ProvideAutoLoad(UIContextGuids80.SolutionExists)]
    

    All available fields of UIContextGuids80:

    • CodeWindow = "{8FE2DF1D-E0DA-4EBE-9D5C-415D40E487B5}"
    • DataSourceWindowAutoVisible = "{2E78870D-AC7C-4460-A4A1-3FE37D00EF81}"
    • DataSourceWindowSupported = "{95C314C4-660B-4627-9F82-1BAF1C764BBF}"
    • Debugging = "{ADFC4E61-0397-11D1-9F4E-00A0C911004F}"
    • DesignMode = "{ADFC4E63-0397-11D1-9F4E-00A0C911004F}"
    • Dragging = "{B706F393-2E5B-49E7-9E2E-B1825F639B63}"
    • EmptySolution = "{ADFC4E65-0397-11D1-9F4E-00A0C911004F}"
    • FullScreenMode = "{ADFC4E62-0397-11D1-9F4E-00A0C911004F}"
    • NoSolution = "{ADFC4E64-0397-11D1-9F4E-00A0C911004F}"
    • NotBuildingAndNotDebugging = "{48EA4A80-F14E-4107-88FA-8D0016F30B9C}"
    • SolutionBuilding = "{ADFC4E60-0397-11D1-9F4E-00A0C911004F}"
    • SolutionExists = "{F1536EF8-92EC-443C-9ED7-FDADF150DA82}"
    • SolutionExistsAndNotBuildingAndNotDebugging = "{D0E4DEEC-1B53-4cda-8559-D454583AD23B}"
    • SolutionHasMultipleProjects = "{93694FA0-0397-11D1-9F4E-00A0C911004F}"
    • SolutionHasSingleProject = "{ADFC4E66-0397-11D1-9F4E-00A0C911004F}"
    • SolutionOrProjectUpgrading = "{EF4F870B-7B85-4F29-9D15-CE1ABFBE733B}"
    • ToolboxInitialized = "{DC5DB425-F0FD-4403-96A1-F475CDBA9EE0}"
    • WindowsFormsDesigner = "{BA09E2AF-9DF2-4068-B2F0-4C7E5CC19E2F}"

    So, i see the next - SolutionExists has only variant for work with events what is invoked before of all in comparison with other... (note: it's only contains the constants with some GUID, so maybe there are other guid's - internal, this should be worked by subscription or similar for calling the all of registered packages)

    I remember i also tested with the NoSolution ({ADFC4E64-0397-11D1-9F4E-00A0C911004F}) & SolutionBuilding ({ADFC4E60-0397-11D1-9F4E-00A0C911004F}) (when replying in Q/A), but result is similar..

    What interesting:

    if you can put another extension with the same GUID in directory

    \Microsoft Visual Studio <Number>.0\Common7\IDE\Extensions\
    

    (for example, just copy vsSBE in other catalog)

    and execute next command:

    devenv "D:/tmp/Project.sln" /build Release /Log d:\tmp\cmdlog.xsl
    

    you can watch like this:

    Extension will not be loaded because an extension with the same ID '94ecd13f-15f3-4f51-9afd-17f0275c6266' is already loaded at ....Common7\IDE\Extensions\netreg\vsSolutionBuildEvent\...
              C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\<Number>.0\Extensions\vw1nnqlu.vyy\
    

    where vw1nnqlu.vyy - is a dir with some hashcode as name

    SO! plugin realy has loaded, however not activated... i mean not has instance of vsSolutionBuildEventPackage

    above in log he is loaded as

    88  Scanning pkgdef file
              \AppData\Local\Microsoft\VisualStudio\<num>\Extensions\t12epaqi.0jb\vsSolutionBuildEvent.pkgdef   VisualStudio 
    89  Importing pkgdef file
              \AppData\Local\Microsoft\VisualStudio\<num>\Extensions\t12epaqi.0jb\vsSolutionBuildEvent.pkgdef   VisualStudio 
    

    It means, instance should be only if we have a some specific context! some guid ?

    known when our extension is loaded and activated:

    any commands who will activate IDE:
      devenv /Command "File.Exit" 
      devenv "<Project.sln>" /Runexit
      ...
    
    or! simple:
      devenv.com /?   yes, it works...
    

    Possible or not ? hmm., still no information - this feature still not yet watched! You or any probably help me to find any documentation, and i'll implement this if it's possible - I mean, if it's not a some restriction from MS (again)

    another details about this, see Q/A - using extension in command line mode (devenv.exe)

    I accepted this Issue, however need a more information about this...

  2. Denis Kuzmin repo owner

    it's possible with Add-in for devenv.com,

    today i checked this.. should all work

    However! add-ins are deprecated in Visual Studio 2013 and removed in 14CTP (also in VS2015 Preview)

    i.e. i can provide a some "bridge" for our lib, but this should work only for 2010, 2012 and 2013

    -_-

    special for CI... later i can also provide additional wrapper for emulating events with additional utility - this is so because most ci servers includes only assembling with msbuild (our lib works with VS, but it's also possible)

    maybe as wrapper to the msbuild... need to think

  3. Denis Kuzmin repo owner

    Command-Line has been implemented in 1727b22

    should work on VS2010, VS2012 and VS2013, for example:

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE>devenv "D:\tmp\ForTestApp\ForTestApp.sln" /Rebuild Release
    ============================================================
    [[ vsSolutionBuildEvent Devenv Command-Line ]] Welcomes You!
    ============================================================
    Feedback: entry.reg@gmail.com
    ____________________________________________________________
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.CommentComponent'
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.ConditionComponent'
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.UserVariableComponent'
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.OWPComponent'
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.DTEComponent'
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.InternalComponent'
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.BuildComponent'
    08.01.2015 20:20:24 [TRACE]: init: 'net.r_eg.vsSBE.SBEScripts.Components.FileComponent'
    
    Library: loaded from 'C:\Users\reg\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\jnhdeh52.ukq\' :: v0.10.0.267410 [6db2698] /'local_console':196
    08.01.2015 20:20:26 [INFO]: Loaded settings (v0.9): 'D:\tmp\ForTestApp\'
    
    Ready:
    
    08.01.2015 20:20:26 [INFO]: Launching action 'Test cmd' :: Configuration - 'Release|x86'
    08.01.2015 20:20:26 [INFO]: Use File Mode
    08.01.2015 20:20:26 [INFO]: Prepared command: 'calc.exe'
    08.01.2015 20:20:28 [INFO]: [Pre] finished SBE: Test cmd
    
    08.01.2015 20:20:28 [TRACE]: onProject: 'ForTestApp':Before == True
    
    ------ Rebuild All started: Project: ForTestApp, Configuration: Release x86 ------
    
    ... build log ....
    
    Build succeeded.
    
    Time Elapsed 00:00:00.35
    08.01.2015 20:20:29 [TRACE]: onProject: 'ForTestApp':After == True
    
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    08.01.2015 20:20:29 [DEBUG]: Reseted all User-variables
    
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE>
    

    Important:

    • the Add-in calls all logic from the vsSolutionBuildEvent with API (for example - IEvent), therefore for working need a vsSolutionBuildEvent library
    • It's not end implementation, it means what can be a some changes before the new public release!

    For Continuous Integration - should be other special implementation, later

    /For developers, you can already test and work with 1727b22

  4. Denis Kuzmin repo owner

    For CI support we decided to perform implementation with the MSBuild loggers for events base

    /draft 4f601bb

    I think it's best variant:

    • Firstly, this model of events is similar(not the same, but..) with VisualStudio.Shell.Interop/EnvDTE, and i already implemented basic events... see draft
      • moreover, we can use additional elements with msbuild building etc.
    • Secondly, we can use a few loggers if it's already used, e.g. AppVeyor used for example:
    "C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "<file>.sln" /m /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    

    flexibility for any situation...

    however, later i'll also add the simple utility for additional support

    What's left to do:

    • Completely implementation of events model for CI.MSBuild (see TODO in commit)
    • I also have plans for moving this project on some CI server - it's also the best variant for test and support this features. Therefore, generally this features should be after successfully moved.
      • Note: CI for this project a little harder, because this project also used the Visual Studio SDK and self assembly, however i think it's possible :) time will tell
  5. Denis Kuzmin repo owner

    tested build of the vsSolutionBuildEvent with TeamCity & AppVeyor --> see commit 1cdb39b

    AppVeyor:

    Build started
    git clone -q --branch=ci https://bitbucket.org/3F/ci_cfg_vssbe.git C:\projects\ci-cfg-vssbe
    git checkout -qf 4fd802c4f4db54be98ee533e0f9c6ad85ca42867
    nuget restore vsSolutionBuildEvent_2013.sln & "C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe" "vsSolutionBuildEvent_2013.sln" /m /verbosity:detailed /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /l:"C:\projects\ci-cfg-vssbe\external\bin\CI.MSBuild.dll"
    Installing 'Moq 4.2.1409.1722'.
    Installing 'AvalonEdit 5.0.2'.
    Installing 'UDE.CSharp 1.1.0'.
    Installing 'Newtonsoft.Json 6.0.6'.
    Installing 'NLog 3.1.0.0'.
    Successfully installed 'UDE.CSharp 1.1.0'.
    Successfully installed 'Moq 4.2.1409.1722'.
    Successfully installed 'NLog 3.1.0.0'.
    Successfully installed 'AvalonEdit 5.0.2'.
    Successfully installed 'Newtonsoft.Json 6.0.6'.
    Microsoft (R) Build Engine version 12.0.31101.0
    [Microsoft .NET Framework, version 4.0.30319.34209]
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    ============================================================
    [[ vsSolutionBuildEvent CI.MSBuild ]] Welcomes You!
    ============================================================
    Feedback: entry.reg@gmail.com
    ____________________________________________________________
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    Build started 1/22/2015 8:51:21 PM.
    1/22/2015 8:51:33 PM [WARN]: Context of build action: Disabled for current Environment.
    Library: loaded from 'C:\projects\ci-cfg-vssbe\external\bin\' :: v0.10.1.287804 [89128de] /'local_ci_step2':187
    1/22/2015 8:51:35 PM [INFO]: Loaded settings (v0.9): 'C:\projects\ci-cfg-vssbe\'
    
    Ready:
    
    1 / 1] Pre-Build :: [!]
    0 / 1] Post-Build :: [X]
    0 / 1] Cancel-Build :: [X]
    0 / 1] Warnings-Build :: [X]
    0 / 1] Errors-Build :: [X]
    0 / 1] Output-Build :: [X]
    0 / 1] Transmitter :: [X]
    ---
    1/22/2015 8:51:35 PM [INFO]: vsSBE tool pane: View -> Other Windows -> Solution Build-Events
    1/22/2015 8:51:35 PM [INFO]: Launching action 'Updating version' :: Configuration - 'Debug|AnyCPU'
    1/22/2015 8:51:35 PM [INFO]: Use Script Mode
    1/22/2015 8:51:41 PM [INFO]: [Pre] finished SBE: Updating version
    Project "C:\projects\ci-cfg-vssbe\vsSolutionBuildEvent_2013.sln" on node 1 (default targets).
    Building with tools version "2.0".
    Target "ValidateSolutionConfiguration" in file "C:\projects\ci-cfg-vssbe\vsSolutionBuildEvent_2013.sln.metaproj" from project "C:\projects\ci-cfg-vssbe\vsSolutionBuildEvent_2013.sln" (entry point):
    ...
    Build succeeded.
    
    "C:\projects\ci-cfg-vssbe\vsSolutionBuildEvent_2013.sln" (default target) (1) ->
    "C:\projects\ci-cfg-vssbe\vsSolutionBuildEventTest\vsSolutionBuildEventTest_2013.csproj" (default target) (7) ->
    (ResolveAssemblyReferences target) ->
    C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1697,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [C:\projects\ci-cfg-vssbe\vsSolutionBuildEventTest\vsSolutionBuildEventTest_2013.csproj]
    
    1 Warning(s)
    0 Error(s)
    
    Time Elapsed 00:01:11.40
    Discovering tests...OK
    vstest.console /logger:Appveyor "C:\projects\ci-cfg-vssbe\vsSolutionBuildEventTest\bin\Debug\vsSolutionBuildEventTest.dll"
    Microsoft (R) Test Execution Command Line Tool Version 12.0.30723.0 
    Copyright (c) Microsoft Corporation. All rights reserved. 
    
    Starting test execution, please wait... 
    ...
    Total tests: 233. Passed: 233. Failed: 0. Skipped: 0.
    Test Run Successful. 
    Test execution time: 6.6070 Seconds 
    Build success
    

    TODO:

    • warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved
    • VSSDK 2010 for build on .NET 4.0
  6. Log in to comment