dotnet/aspnetcore

Unified project system (new TFM integration with build/publish/SWA)

mkArtakMSFT opened this issue ยท 5 comments

  • Support net8.0-browser TFM on the SDK and runtime side.
  • Update Static Web Assets to account for multitargeted projects.
    • The project needs to include the assets produced by the net8.0-browser TFM.
    • We need to handle the different TFM combinations here
    • We need to do work to support multi-targeting during build and publish.

Also copying a comment from #48758:

We need to update the new project template and SDK rules so that:

  • There are good conventions for including/excluding things in the Server and WebAssembly builds based on:
    • Directory
    • Filename
    • #if
  • We help developers not to include code or other assets like config in the WebAssembly compilation by mistake
    • For example, we might only include .cs files from a WebAssembly or Shared directory
    • For project/package references, we might have special metadata for "server", "webassembly", and "shared". Then if you add any project/package reference and it doesn't have this metadata (which is the case by default) then:
      • During development this logs a warning
      • During publish it's an error
      • ... so that developers aren't prevented from following existing tutorials (especially important for learners) but they do get a reasonable warning that they have to take some action before publishing to express a clear intent

Hi! I started testing and loving the new Blazor since RC1.

I noticed this unified experience is not in .net8 milestone anymore.

Will we be able to create a single project with Server and Client elements, at least in a preliminary way with .NET8?

  • maybe with some experimental tool?
  • Or only in .NET9?
  • Or has this not been decided yet?

Thanks!


FYI, I'd like to structure something like this:

  • My.Project.csproj
    • Server/ (server only)
      • Components/
        • HomePage.razor
    • WebAssembly/
      • Components/
        • PeoplePage.razor (Auto)
    • Application/
      • People/
        • ListPeopleHandler.server.cs (server only)
        • ListPeopleHandler.client.cs (client only)
        • IListPeopleHandler.cs (both)
        • PersonDto.cs (both)

@guimabdo No, because of clear community feedback in #49079, we decided to focus on the multiproject solution for .NET 8 (that is, when you need both Server and WebAssembly build outputs). We are still open to creating a single project option in .NET 9 or later, but there is no option for that in .NET 8.

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.