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

Handle Web Site project #2

Open
r-pankevicius opened this issue Jul 16, 2019 · 3 comments
Open

Handle Web Site project #2

r-pankevicius opened this issue Jul 16, 2019 · 3 comments

Comments

@r-pankevicius
Copy link

ASP.NET web site project is a folder, not project file, project type Guid is E24C65DC-7377-472B-9ABA-BC803B73C61A.

VisualStudioSolutionUpdater fails handling web site solution file with a message like:

Bad Solution C:\Dev\BlahBlah\Webs\MyWebSite.sln Error Access to the path 'C:\Dev\BlahBlah\Webs\MyWebSite' is denied.

To fix this, in SolutionUtilities.GetProjectsFromSolution() ignore project type SolutionProjectType.WebProject the same way as you do with SolutionProjectType.SolutionFolder.

@r-pankevicius
Copy link
Author

That needs more investigation: not exclude web site project but instead track it's references to other projects.

@aolszowka
Copy link
Owner

aolszowka commented Dec 19, 2019

Would it be possible for you to provide or tell me how to create such a project? (I do not have a copy of one). How would one be created "normally" (IE within Visual Studio)? I do see some references in unit tests like this one here: https://github.com/microsoft/msbuild/blob/e70a3159d64f9ed6ec3b60253ef863fa883a99b1/src/Deprecated/Engine/Shared/UnitTests/SolutionParser_Tests.cs

One possible solution (if I would ignore the entire project) would be to do this:

internal static IEnumerable<string> GetProjectsFromSolution(SolutionFile solution)
{
    HashSet<SolutionProjectType> excludedSolutionProjectTypes =
        new HashSet<SolutionProjectType>
        {
            SolutionProjectType.SolutionFolder,
            SolutionProjectType.WebProject,
        };

    return
        solution
        .ProjectsInOrder
        .Where(project => !excludedSolutionProjectTypes.Contains(project.ProjectType))
        .Select(project => Path.GetFullPath(project.AbsolutePath));
}

But your next comment seems to indicate that it might be nice to chase down those dependencies (which I agree with).

@r-pankevicius
Copy link
Author

This is how to create such project (it's called ASP .NET Web Forms Site).
Normally today people do not create such web sites, they can be found as legacy.
asp-net-web-forms-website

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