forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workload] move all build tasks out of library-packs
Fixes: https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1459138 Fixes: dotnet#4098 This partially reverts 974cac4. Creating a new MAUI solution, results in several intellisense errors: CS0103: The name 'InitializeComponent` does not exist in the current context. The missing members are created by the (previously XamlG) Roslyn source generator. You can go-to definition the missing members, build & run works, and if you close/reopen the solution the errors go away. Unchecking the `Run code analysis in a separate process`, also seems to solve the issue. .NET MAUI seems to be using an intersection of features that causes this problem: 1. We have a `dotnet new maui` project template. 2. We have a source generator in a NuGet package. 3. We have MSBuild targets that setup the source generator in a NuGet package. 4. We use `AdditionalFiles` to pass `.xaml` files in to the source generator. What happens on the first project load, the design-time builds *before* project restore are missing the source generator. So the call to `<Csc/>` does not have `@(Analyzer)` or `AdditionalFiles` at all. To solve this issue, we can move everything *out* of NuGet packages, so they become regular "SDK" or workload packs: * `Microsoft.Maui.Controls.Build.Tasks` is no longer packable * all files moved to `Microsoft.Maui.Sdk` * `Resizetizer.csproj` is no longer packable * actual files are in `Microsoft.Maui.Resizetizer.Sdk` * `$(MauiVersion)` no longer applies to build tasks Testing locally, this seems to solve the problem for me. I can see the `@(Analyzer)` and `AdditionalFiles` being passed on all design-time builds now. Other changes: * I added `%(IsImplicitlyDefined)` to the source generator assembly. I just noticed this was missing while reading `.binlog` files. * I put all files in the `Sdk` folder in `Microsoft.Maui.Sdk`. This seems a bit simpler to have one directory.
- Loading branch information
1 parent
6ac02a3
commit cc59925
Showing
16 changed files
with
65 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/Workload/Microsoft.Maui.Resizetizer.Sdk/Microsoft.Maui.Resizetizer.Sdk.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters