Skip to content
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

Map not Refreshing #55

Closed
D3ADD3V3R opened this issue Sep 9, 2022 · 2 comments
Closed

Map not Refreshing #55

D3ADD3V3R opened this issue Sep 9, 2022 · 2 comments

Comments

@D3ADD3V3R
Copy link

Hi,
I have a solution with over 500 projects and more than 10 build configurations. The goal is to delete all build configurations except for the two default ones, and to do the same for the projects. I have read through Issue #3, and I can successfully remove the data from the SLN. However, when I look at “Map”, all the configurations are still there, and are saved again accordingly. Is there a way to update this map ?

I have attached my Code to this Request and will be thankfull for your help.

using var sln = new Sln(openFileDialog1.FileName, SlnItems.AllNoLoad | SlnItems.PackagesConfig);

sln.Result.SolutionConfigs.ToList().ForEach(c =>
{
    if (!(c.Configuration == "Debug" && c.Platform == "Any CPU") && !(c.Configuration == "Release" && c.Platform == "Any CPU"))
        ((SlnResult)sln.Result).SolutionConfigList.Remove(c);
});

((SlnResult)sln.Result).ProjectConfigList.ToList().ForEach(c =>
{
    if(!(c.Configuration == "Debug" && c.Platform == "Any CPU") && !(c.Configuration == "Release" && c.Platform == "Any CPU"))
        ((SlnResult)sln.Result).ProjectConfigList.Remove(c);
});,

var whandlers = new Dictionary<Type, HandlerValue>();

using (var w = new SlnWriter(openFileDialog1.FileName, whandlers))
{
    w.Write(sln.Result.Map);
}

Kind regards,
Björn

@3F
Copy link
Owner

3F commented Sep 13, 2022 via email

@3F
Copy link
Owner

3F commented Apr 29, 2024

I close the issue because as I said you just need to update your runtime collections; then save the result into file or string.

Feel free to open an issue again if the problem still exists.

@3F 3F closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants