Skip to content

Allow SDK style project OutputType to be None/Shared #8075

@bgyu

Description

@bgyu

Is your feature request related to a problem? Please describe.

I have two (or more) C# projects with SDK style. I want to share code between them, but I don't want to create a shared library, because they may target at different frameworks, for example, one is targeting at .net framework 4.8, the other is targeting at .net 6.0. I don't want to create two more shared assemblies targeting at different frameworks to increase the complexity. I just want to share some source code. The most important, I don't need to change the access modifier (visiblity) of class or its members, for example, I don't need to change internal class to public so that it can be accessed by other projects. The source code in the shared project should behave like they are part of referenced project.

I can use existing shared project (for c#), but it's not with SDK style. I have to manually add shared sources and their folder structures. I just want it works like SDK-style project, including all source code structures automatically, no explicit <Compile Include="xxx.cs" />.

In one word, I want a C# SDK style project which is only used for project reference (should work for both Windows and Linux), and it doesn't generate any output itself.

Describe the solution you'd like.

A new SDK style project OutputType, allows no output. For example, OutputType can be None, which generates no output. The purpose of this project is just used for project reference (sharing between projects). Can be something like this:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>None</OutputType>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

</Project>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions