Open YakupIpek21 opened 2 years ago
Yes, add this NuGet package to the project.
It adds a build step that runs the analysis. The intention is to allow you to have XAML analysis of a project even if the extension is not installed. (Such as on a build server 😉)
Note that the currently available version also suffers from the issue identified in #503 and so a new version of the RapidXaml.BuildAnalysis
package is also needed.
I see, thank you very much for the explanation
Version 0.13.0 of this NuGet package is now available and fixes the issue noted in #503 Example:
PLEASE NOTE. This currently only works with projects that use the old internal structure. It does not yet work with SDK-style projects (As you'll get if you create a project targeting .NET5 or 6. The changes to support SDK style projects is being tracked separately in #408
If you have any problems, comments, or suggestions please raise another issue. If you love it, please leave a rating/review or consider sponsorship :smile:
After having added the RapidXaml.BuildAnalysis nuget package to the project which contains the xaml files, it does not produce any warnings when the project is built in VisualStudio 19
Expected Behaviour When building a project which contains xaml files, the analysis should be triggered and warnings should be displayed
To reproduce
Generate a custom analyzer
Add the project as a reference to the project containing xaml files (let's denote it as project A)
Add the RapidXaml.BuildAnalysis nuget package (Version 0.13.0) to the project A
In project A add a TextBlock Tag without the IsEnabled Attribute, save the file
Enable in the options the Enable Custom Analysis menu
When a warning is shown then restart VS19, so that no warning is shown, now build project A
In my case no warning is shown in VS19
After having added the RapidXaml.BuildAnalysis nuget package to the project which contains the xaml files, it does not produce any warnings when the project is built in VisualStudio 19
What type of project are you using? Can you share a complete reproduction project, not just a partial description.
Also, please note, from above:
PLEASE NOTE. This currently only works with projects that use the old internal structure. It does not yet work with SDK-style projects (As you'll get if you create a project targeting .NET5 or 6.) The changes to support SDK style projects is being tracked separately in https://github.com/mrlacey/Rapid-XAML-Toolkit/issues/408
Yes sure. The following reproduction steps refer to Visual Studio 2019 Version 16.11.5
Expected Behaviour When building the project in Visual Studio 2019 the warnings should be displayed in the Error List Window without needing to open or saving the xaml file in Visual Studio 2019.
Unfortunately, WPF with .Net Core 3.1 also uses an SDK style project format and so the BuildAnalysis doesn't know which files to check. This is why it is not reporting anything.
I'll look to prioritize supporting this. (Very few people have been using RXT with WPF projects and so this is a good opportunity to improve this experience.)
Question Is there a way to automatically trigger the custom analyzer when a project containing a xaml is built? Not only when the file is saved.
Desired Behaviour So any project referencing a custom analyzer should automatically analyze its existing Xaml files.