Comments (8)
Thanks for providing all this great info!
I can confirm that I get errors in these versions
Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.2.6
Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.3.0 Preview 1.1
I'll continue investigating. This bug makes me very sad.
from boilerplatezero.
Good news!
This is a known bug with a workaround that I found here - dotnet/wpf#6792 (comment)
<Target Name="RemoveDuplicateAnalyzers" BeforeTargets="CoreCompile">
<!-- Work around https://github.com/dotnet/wpf/issues/6792 -->
<ItemGroup>
<FilteredAnalyzer Include="@(Analyzer->Distinct())" />
<Analyzer Remove="@(Analyzer)" />
<Analyzer Include="@(FilteredAnalyzer)" />
</ItemGroup>
</Target>
from boilerplatezero.
Addendum:
private static readonly DependencyProperty FilenameProperty = Gen.Filename<string>();
causes similar "already contains a definition" errors. It's as if the generated code gets compiled twice.
from boilerplatezero.
Yikes! I haven't seen this problem before.
From what you've said - it does seem as if the code generation is happening 2x
Is there more information in the compiler output log? Perhaps details about file/line where each occurrence exists?
from boilerplatezero.
I have created a minimal test case that reproduces the issue:
- Create a new WPF project (.NET 5)
- Add boilerplatezero via Nuget
- Add
private static readonly DependencyProperty BlaBlaProperty = Gen.BlaBla<string>();
to MainWindow.xaml.cs - Compile fails with mentioned errors
- Commit all to Github
- Deleted the local repo
- Cloned the repo from Github
- Opened local repo with VS.2022, click "Build" - get the same errors
The repo is here: https://github.com/graealex/BpzWpfTestNuget
1>C:\Work\BpzWpfTestNuget\boilerplatezero\Bpz.Wpf.DependencyPropertyGenerator\bpz.DependencyProperties.g.cs(16,18,16,24): error CS0102: The type 'MainWindow' already contains a definition for 'BlaBla'
1>C:\Work\BpzWpfTestNuget\boilerplatezero\Bpz.Wpf.DependencyPropertyGenerator\bpz.DependencyProperties.g.cs(26,37,26,43): error CS0111: Type 'MainWindow.Gen' already defines a member called 'BlaBla' with the same parameter types
from boilerplatezero.
Addendum: the same project compiles fine without any errors in:
Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.3.0 Preview 2.0
The problematic version seems to be:
Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.2.5
Updating to the newest preview version reintroduced the error:
Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.4.0 Preview 1.0
Really not sure what the culprit is.
from boilerplatezero.
build.detailed.log
build.diag.log
Also logs to the build process when launched from command line dotnet build --verbosity diag
and dotnet build --verbosity detailed
from boilerplatezero.
Thank you, @graealex, for donating to support this project! You are very kind.
from boilerplatezero.
Related Issues (6)
- missing support for property-changed methods HOT 1
- Doc Comments for closed Generic types are invalid HOT 1
- Missing support for the ValidateValueCallback method of Register/RegisterAttached HOT 2
- Attached property Get and Set methods have no comments HOT 1
- Missing support for `FrameworkPropertyMetadataOptions`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boilerplatezero.