Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying Specific Projects Example... #38

Closed
DynConcepts opened this issue Dec 29, 2020 · 3 comments
Closed

Modifying Specific Projects Example... #38

DynConcepts opened this issue Dec 29, 2020 · 3 comments
Labels

Comments

@DynConcepts
Copy link

#3

Shows how to modify a Solution, I am looking for how to modify a Project... e.g. Change the $OutDir property and update the (.vcxproj in this case) file...

@3F
Copy link
Owner

3F commented Dec 30, 2020

IXProject in 2.x wraps an msbuild, so you can simply use it separately or such as

IXProject xp = ...
xp.SetProperty("OutDir", "new-value");
xp.Save();

/// Sets or adds a property with the given name and unevaluated value to the project.
/// </summary>
/// <param name="name">The name of the property.</param>
/// <param name="unevaluated">The new unevaluated value of the property.</param>
/// <returns></returns>
PropertyItem SetProperty(string name, string unevaluated);

easy to group like

xp.SetProperties(new Dictionary<string, string>()
{ 
    { "name1", "value1" },
    { "name2", "value2" },
    { "name3", "value3" }
});
  <PropertyGroup>
    <name1>value1</name1>
    <name2>value2</name2>
    <name3>value3</name3>
  </PropertyGroup>

etc.

@3F 3F added the question label Dec 30, 2020
@DynConcepts
Copy link
Author

Close but a related problem has come up... This is covered in Issue #39...

@3F
Copy link
Owner

3F commented Jan 2, 2021

I think it's time to play with new Discussions for the similar general questions like this.

@DynConcepts Please use Discussions for cases like this instead of opening new Issues. We'll test it together. Thanks.

@3F 3F closed this as completed Feb 15, 2021
Repository owner locked and limited conversation to collaborators Feb 15, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants