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

[BUG]: Support parsing solution configuration mappings for projects which don't have a platform #24

Closed
icnocop opened this issue Aug 23, 2023 · 1 comment · Fixed by #25
Assignees
Labels
bug Something isn't working

Comments

@icnocop
Copy link
Contributor

icnocop commented Aug 23, 2023

Description of the feature/enhancement

Hi.

When trying to parse a solution file which contains an SQL Server Integration Services (SSIS) Project (i.e. *.dtproj), the following exception occurs:

SlnParser.Contracts.Exceptions.ParseSolutionFailedException: Could not parse provided Solution 'C:\Test\Test.sln'. See inner exception for more information
 ---> SlnParser.Contracts.Exceptions.UnexpectedSolutionStructureException: Expected to find ConfigurationPlatform but pattern did not match

*.dtproj files don't have the same XML schema as *.csproj or *.vcxproj, files for example, and only contain a project configuration name without a platform.

Here's an example sln file which contains a *.dtproj:
https://github.com/Badrinarayanan-ah/Adhere-Health/blob/ab151354ce44ce87f2d87564b8acd34f526f62e0/DeathAndDisenrollment/DND.sln#L1-L21

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{D183A3D8-5FD8-494B-B014-37F57B35E655}") = "DNDy", "DND\DeathAndDisenrollment.dtproj", "{D74B44EA-F09D-49F3-B0EF-CB159746A372}"
EndProject
Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Development|Default = Development|Default
        EndGlobalSection
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
                {D74B44EA-F09D-49F3-B0EF-CB159746A372}.Development|Default.ActiveCfg = Development
                {D74B44EA-F09D-49F3-B0EF-CB159746A372}.Development|Default.Build.0 = Development
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
        EndGlobalSection
        GlobalSection(SubversionScc) = preSolution
                Svn-Managed = True
                Manager = AnkhSVN - Subversion Support for Visual Studio
        EndGlobalSection
EndGlobal

The regular expression pattern

@"((?<projectId>\{[A-Za-z0-9\-]+\}).)?(?<name>.+) = (?<buildConfiguration>.+)\|(?<buildPlatform>.+)";
will not match line 11 because it does not have a | after = Development.

Thank you.

Additional Information

No response

@icnocop icnocop added the enhancement New feature or request label Aug 23, 2023
@wgnf
Copy link
Owner

wgnf commented Aug 23, 2023

Okay thank you. I'll have a look at this in the coming days, probably not tomorrow though.

Feel free to open up a PR if you want to fix this yourself.

@wgnf wgnf changed the title [FEAT]: Support parsing solution configuration mappings for projects which don't have a platform [BUG]: Support parsing solution configuration mappings for projects which don't have a platform Aug 23, 2023
@wgnf wgnf added bug Something isn't working and removed enhancement New feature or request labels Aug 23, 2023
icnocop added a commit to icnocop/SlnParser that referenced this issue Aug 23, 2023
@wgnf wgnf closed this as completed in #25 Aug 25, 2023
wgnf pushed a commit that referenced this issue Aug 25, 2023
…ch don't have a platform (#25)

* Support parsing solution configuration mappings for projects which don't have a platform
Fixes #24

* Fixed coding style
Moved sln file contents to external file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants