Skip to content

Open an existing project --- Without a Solution... #37

Closed

Description

@DynConcepts

(Happy Holidays).... I would have thought this easy, but hours in, and no success...

Activity

  1. 3F commented on Dec 30, 2020

    @3F
    Owner

    Thank you, and happy holidays to you too!

    I would have thought this easy,

    I think that's the way it is ~

    var xp = new XProject("project file");
    
    // ... do something
    xp.GetProjectReferences().Count();

    But for another powerful loading/managing take a look at IEnvironment -> IXProjectEnv; Here's old note

  2. DynConcepts commented on Jan 2, 2021

    @DynConcepts
    Author

    Thanks... When i was "doing the crazy" of finding a solution that contained the project, then opening the solution, then selecting the project.... I was able to load a specific configuration... I do not see how to do that for a direct XPRoject constructor call...

    OLD Code (for laughing)

                       List<net.r_eg.MvsSln.Core.ProjectItemCfg> proj = data.ProjectItemsConfigs.Where(p =>
                        (p.project.fullPath.ToLower() == projInfo.FullPath.ToLower()) &&
                        (p.projectConfig.Configuration.ToLower() == desiredConfiguration.ToLower()) && (p.projectConfig.Platform == desiredPlatform)
                        ).ToList();
                        if (proj.Count == 0)
                        {
                            SimpleLogger.WriteLine("Project Load Failure for Configuration");
                            return null;
                        }
                        if (proj.Count > 1)
                        {
                            SimpleLogger.WriteLine("Project Load Ambigious for Configuration");
                            return null;
                        }
                        data.Env.LoadProjects(new[] { proj[0] });
                        net.r_eg.MvsSln.Core.IXProject targetProject = data.Env.Projects.First();
    
    
  3. 3F commented on Jan 2, 2021

    @3F
    Owner

    Not even sure what are you trying here :)

    Environment implementations contains various loaders of the each project instances. This is manger where you can simply manage project collections through its single entity (the default implementations are IsolatedEnv/XProjectEnv).

    For other cases you can use XProject or direct implementations (msbuild or future IeXod)

  4. Repository owner locked and limited conversation to collaborators on Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions