3F / vsSolutionBuildEvent

🎛 Event-Catcher with variety of advanced Actions to service projects, libraries, build processes, runtime environment of the Visual Studio, MSBuild Tools, and …
Other
79 stars 22 forks source link

Open other solution with own vssbe settings #30

Closed 3F closed 8 years ago

3F commented 9 years ago

Originally reported by: Anonymous


The code below is initialized only once per VS Studio instance and it prevents to load other solution which has own vssbe settings: ///

    /// Thread-safe getting the instance of Config class
    /// </summary>

    public static Config _
    {
        get { return _lazy.Value; }
    }
    private static readonly Lazy<Config> _lazy = new Lazy<Config>(() => new Config());

3F commented 9 years ago

Original comment by Denis Kuzmin (Bitbucket: 3F, GitHub: 3F):


Thanks for confirmation!

v0.12.2 is already contains current fixes.

Changelog entry:

* FIXED: The configuration file is always loading only from first loaded solution.

Finally the SourceForge is now working too!

File upload service data has been reconstructed and is pending final copying, ETA for service restoration is end of day 7/31.

Has been fixed a few hours ago... need to think about new place for all releases @sfnet_ops

3F commented 9 years ago

Original comment by Sergey Vasiliev (Bitbucket: raidersv, GitHub: raidersv):


Confirm, the fix solves this issue.

3F commented 9 years ago

Original comment by Denis Kuzmin (Bitbucket: 3F, GitHub: 3F):


this problem should be resolved with b716fa5

you can check this in Debug version here

3F commented 9 years ago

Original comment by Denis Kuzmin (Bitbucket: 3F, GitHub: 3F):


Thank you Sergey!

I think I found problems in Environment. Well, I see problems for your case with SolutionPath & SolutionFileName at least

later I'll push fixes, so you can test with debug version before public releases

stay in touch

3F commented 9 years ago

Original comment by Sergey Vasiliev (Bitbucket: raidersv, GitHub: raidersv):


The problem when I have 2 solutions with own VSSBE settings:

  1. Run VS
  2. Open solution 1 with own VSSBE settings -> settings are OK
  3. Open solution 2 with own VSSBE settings in the same VS instance -> settings are taken from solution 1.
3F commented 9 years ago

Original comment by Denis Kuzmin (Bitbucket: 3F, GitHub: 3F):


The code below is initialized only once per VS Studio instance

yes, used Singleton pattern, and this thread-safe variant:

#!csharp

public static Config _
{
    get { return _lazy.Value; }
}
private static readonly Lazy<Config> _lazy = new Lazy<Config>(() => new Config());

and it prevents to load other solution which has own vssbe settings

please describe in details about your problem or what you want!

For each opened solution should be call IEvent.solutionOpened

#!csharp

/// <summary>
/// Solution has been opened.
/// </summary>
/// <param name="pUnkReserved">Reserved for future use.</param>
/// <param name="fNewSolution">true if the solution is being created. false if the solution was created previously or is being loaded.</param>
/// <returns>If the method succeeds, it returns VSConstants.S_OK. If it fails, it returns an error code.</returns>
int solutionOpened(object pUnkReserved, int fNewSolution);

you should see implementation of this here /where we will update SolutionEvents data from other solution

please also note: you can use .vssbe for each .sln - <SolutionFile>.vssbe, see .vssbe File for details.

In general, your issue is not clear.

If you see some bug: please describe steps of how to reproduce your problem [?]. You can also send patch if you know what to do, I review this later...

Thanks for using,