Coder Social home page Coder Social logo

Comments (2)

jeffkl avatar jeffkl commented on September 1, 2024

The code above is slightly different than you think. SlnGen uses an MSBuild API called "Static Graph" which loads all projects and then loads each project again per target framework. This means if you have:

<PropertyGroup>
  <TargetFramework>net46;netcoreapp3.1</TargetFramework>
</PropertyGroup>

Static graph will load the project 3 times. The code above is ignoring the "inner" projects since they are not needed for solution file generation.

So something else is causing your project to be left out of the solution. This is the code that determines if a project should be in a solution:

/// <summary>
/// Checks whether a project should be included in the solution or not.
/// </summary>
/// <param name="project">The project.</param>
/// <returns><code>true</code> if it should be included, false otherwise.</returns>
internal static bool ShouldIncludeInSolution(Project project)
{
return
!project.GetPropertyValue(MSBuildPropertyNames.IncludeInSolutionFile).Equals(bool.FalseString, StringComparison.OrdinalIgnoreCase) // Filter out projects that explicitly should not be included
&&
!project.GetPropertyValue(MSBuildPropertyNames.IsTraversal).Equals(bool.TrueString, StringComparison.OrdinalIgnoreCase) // Filter out traversal projects by looking for an IsTraversal property
&&
!project.GetPropertyValue(MSBuildPropertyNames.IsTraversalProject).Equals(bool.TrueString, StringComparison.OrdinalIgnoreCase); // Filter out traversal projects by looking for an IsTraversal property
}

Does any of that logic exclude your project?

from slngen.

jeffkl avatar jeffkl commented on September 1, 2024

Closing due to inactivity, feel free to reopen if my suggestion above didn't resolve the issue

from slngen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.