visual studio 2010 - Issues with loading solution (.sln) file using c# -


i trying load solution file using c#. doing using dte object. following code snippet achieve this.

dte dteobject = new dte(); dteobject.solution.open(@solutionfilepath); dteobject.solution.addfromfile(@solutionfilepath); 

now, open particular solution(.sln) file, need set environment variables , values of these environment variables different each solution(.sln) file.

to automate process, have saved values these environment variables each .sln files in dictionary(oldenvlist) , have created solutionloadevents class inheriting ivssolutionevents , overriding onbeforeopensolution method in ivssolutionevents achieve this.

public class solutionloadevents : ivssolutionloadevents, ivssolutionevents {     public solutionloadevents(){}     public int onbeforeopensolution(string pszsolutionfilename)     {      foreach (keyvaluepair<string, string> prop in oldenvlist)      {                                               environment.setenvironmentvariable(prop.key, prop.value);      }      return microsoft.visualstudio.vsconstants.s_ok;     } } 

so, solution file opened dteobject.solution.open(@solutionfilepath); onbeforeopensolution method called , sets required environment variables. there problem, not each , every solution file loaded using way. of projects in shown unavailable

using dte object

but if set required environment variables command prompt , open same solution file command prompt opens properly.

opened command prompt setting env. vars cmd

could guys please tell me going wrong in this? need more while opening in solution file?


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -