🧩 Customizable VisualStudio .sln parser with project support (.vcxproj, .csproj., …). Pluggable lightweight r/w handlers at runtime, and more …
📦.nupkg |
---|
NEW: Added default skeleton for SlnWriter in an attempt to make it easier to create from scratch. Empty .Write() methods will use it by default or merge it with the actual Map.
NEW: Added asynchronous metods* for SlnWriter *Both implementations including legacy netfx4.0 target platform, and async/await for modern.
NEW: Added SMap implementation to wrap ISlnResult.Map. More control over ISection and its handler.
NEW: Added LhDataHelper as an additional way to prepare default handlers from data (ISlnWhData).
LhDataHelper hdata = new();
hdata.SetHeader(SlnHeader.MakeDefault())
.SetProjects(projects)
.SetProjectConfigs(prjConfs)
.SetSolutionConfigs(slnConf);
using SlnWriter w = new(solutionFile, hdata);
See related issue #61 for details.
using SlnWriter w = new(solutionFile, hdata);
w.Options = SlnWriterOptions.CreateProjectsIfNotExist;
// it will write according ProjectType information (both legacy or sdk-style)
w.Write();
Use +IProjectsToucher to override implementation. You can find complete example in #61
NEW: New modern LineBuilder to make creating new handlers easier or control EOL. Related issue #57.
NEW: Added DefaultHandlers wrapper to prepare all default according to ISlnResult(ISlnWhData).
NEW: SlnWriter: + WriteAsString() & WriteAsStringAsync() to save the result as string instead of file.
using SlnWriter w = new(handlers);
string data = await w.WriteAsStringAsync(sln.Result.Map);
NEW: Added platform independent IObjHandler.NewLine to specify the EOL for used w\handlers. +.UpdateNewLine() extension for a collection of handlers.
NEW: New modern IXProject.AddReference(.., AddReferenceOptions) to control everything for Reference
nodes.
Old signatures has been marked as obsolete and scheduled to be removed in future versions.
Default = HideEmbedInteropTypes | HideSpecificVersion,
DefaultResolve = Default | ResolveAssemblyName | OmitArchitecture | OmitCultureNeutral | ...
Mini = Default | HidePrivate,
MiniResolve = Mini | DefaultResolve | OmitCulture,
See related issue #61 for details.
NEW: SlnWriter now supports ISlnResult -> +ISlnWhData data to preapre default handlers itself.
NEW: Implemented overriding of GetHashCode/Equals for ImportElement, RoProperties, Projects.Item.
NEW: +IConfPlatform.IsEqualPair(IConfPlatform)
NEW: ProjectItem adds ability to generate a project name from a specified input path: slnDir\ProjectName\src.csproj -> ProjectName slnDir\ProjectName.csproj -> ProjectName
new ProjectItem(ProjectType.CsSdk, @$"{projName}\src.csproj", slnDir: baseDir)
FIXED: Fixed bug with a disappearing EndProject
. See related #56
FIXED: Fixed duplicated lines when disabling some features through SlnItems.
FIXED: Fixed lines being ignored when handlers are not prepared.
FIXED: If the handler is not initialized as object, the corresponding entry is lost.
FIXED: Fixed PackageInfo == Equals for null.
CHANGED: SlnParser has been switched to UTF8 by default.
CHANGED: SlnWriter now will ignore W\handler that will return null value at IObjHandler.Extract().
CHANGED: Removed comparing of parent project and origin item in PropertyItem.Equals.
CHANGED: SlnHeader is sealed now with new ctors and added SlnHeader.MakeDefault().
CHANGED: ConfigPrj: new ctors +protected internal set for IncludeInBuild and IncludeInDeploy properties.
CHANGED: Projects.Item and PropertyItem: new ctors & renamed evaluatedValue, evaluatedInclude, unevaluatedValue, unevaluatedInclude Old access still is available but marked as obsolete and scheduled to be removed in future versions.
CHANGED: Updated path \ / logic between Windows and unix-like systems.
* FIXED: Incorrect project instances for the active solution configuration in XProject Environment.
Related issue: https://github.com/3F/vsSolutionBuildEvent/issues/71
* FIXED: Fixed possible 'The path is not of a legal form.' when instantiating ProjectItem.
* NEW: Added .IsVc() extension method for ProjectItem objects.
* CHANGED: Updated logic for .IsSdk() extension method.
Now it will use information from ProjectType when null or empty ProjectItem.fullPath.
Otherwise, same logic from v2.5.3 described here:
https://github.com/3F/MvsSln/blob/0ec96021b7/MvsSln/Extensions/ProjectItemExtension.cs#L59-L77
📦 Download | What's new in 2.6:
packages.config support
using Sln l = new("Input.sln", SlnItems.AllNoLoad | SlnItems.PackagesConfig);
IPackageInfo found = l.Result.PackagesConfigs
.SelectMany(s => s.Packages)
.FirstOrDefault(p => p.Id.StartsWith("Microsoft."));
// found.MetaTFM ...
Version v = l.Result.PackagesConfigs.First().GetPackage("LX4Cnh")?.VersionParsed;
FIXED: Fixed CalculateHashCode() Extension. Internally affects many objects due to broken GetHashCode().
FIXED: Fixed SlnItems.ProjectDependenciesXml when empty input: Report https://github.com/3F/MvsSln/issues/25#issuecomment-743840401
NEW: packages.config support PR #30. Related issues #27, #28.
To activate it, use the following flags:
* PackagesConfig, PackagesConfigSolution, PackagesConfigLegacy.
Including GetNuTool compatible packages, format:
https://github.com/3F/GetNuTool#format-of-packages-list
NEW: Added HasValue and HasNothing properties in PropertyItem.
NEW: Added SlnItems.AllMinimal and SlnItems.AllNoLoad in addition to SlnItems.All.
NEW: Added IXProject.GetPackageReferences().
CHANGED: ConfigItem.Format() marked as obsolete.
Use ToString()
and IConfPlatform.Formatted
instead.
🎲 Nightly build
of bb4188839af2514e72907a7e0f8378c682763810 ➾ Worker image: Visual Studio 2017
; Console: ci.appveyor.com/.../build-50
❕ Only for tests ❕ 🗨 Commit message:
Fixes #19
+updated tests
🎲 Nightly build
of 7d7fb00edb48b896b0b464f19850c41e95444e58 ➾ Worker image: Visual Studio 2017
; Console: ci.appveyor.com/.../build-49
❕ Only for tests ❕ 🗨 Commit message:
Merge pull request #17 from 3F/support/vssbe/pr53
XProjectEnv base, MSBuild Properties helpers, and other relevant changes due to integration with vsSolutionBuildEvent