Compilation errors in CustomerDetails.g.cs caused by x:Bind
See original GitHub issueI can’t build the project using Visual Studio 2017 15.9 Preview 3 & SDK 17763.
The errors are:
3>------ Build started: Project: Inventory.App, Configuration: Debug x86 ------
3>C:\Users\habakker\Source\Repos\InventorySample\src\Inventory.App\Controls\Buttons\RoundButton.cs(44,29,44,41): warning CS0108: 'RoundButton.CornerRadius' hides inherited member 'Control.CornerRadius'. Use the new keyword if hiding was intended.
3>C:\Users\habakker\Source\Repos\InventorySample\src\Inventory.App\Controls\Buttons\RoundButton.cs(50,51,50,71): warning CS0108: 'RoundButton.CornerRadiusProperty' hides inherited member 'Control.CornerRadiusProperty'. Use the new keyword if hiding was intended.
3>C:\Users\habakker\Source\Repos\InventorySample\src\Inventory.App\obj\x86\Debug\Views\Customer\Details\CustomerDetails.g.cs(924,72,924,87): error CS0029: Cannot implicitly convert type 'string' to 'int?'
3>C:\Users\habakker\Source\Repos\InventorySample\src\Inventory.App\obj\x86\Debug\Views\Customer\Details\CustomerDetails.g.cs(950,71,950,86): error CS0029: Cannot implicitly convert type 'string' to 'decimal?'
The offending parts are:
private void UpdateTwoWay_17_Text()
{
if (this.initialized)
{
if (this.dataRoot != null)
{
if (this.dataRoot.EditableItem != null)
{
this.dataRoot.EditableItem.TotalChildren = this.obj17.Text; //this line
}
}
}
}
and
private void UpdateTwoWay_19_Text()
{
if (this.initialized)
{
if (this.dataRoot != null)
{
if (this.dataRoot.EditableItem != null)
{
this.dataRoot.EditableItem.YearlyIncome = this.obj19.Text; //and this line
}
}
}
}
The error seems to be in the x:Bind
generated code which seems not process the DataType="Decimal"
and DataType="Integer"
attribute correctly. This attribute is used at https://github.com/Microsoft/InventorySample/blob/master/src/Inventory.App/Views/Customer/Details/CustomerDetails.xaml#L39,L43
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Compilation errors in CustomerDetails.g.cs caused by x:Bind
I can't build the project using Visual Studio 2017 15.9 Preview 3 & SDK 17763. The errors are: 3>------ Build started: Project: Inventory....
Read more >Error in a .g.cs file?
In my case , I was tried to name a xaml control using x:Name , and forgot , and kept it as x:Name=""...
Read more >{x:Bind} markup extension - UWP
At XAML compile time, {x:Bind} is converted into code that will get a value from a property on a data source, and set...
Read more >VS 2022 compile error WMC111 - Microsoft Q&A
I migrate some app from WPF to WinUI 3. Compiler set error on Russian symbols in binding: Ошибка WMC1110 Invalid binding path 'vm.User....
Read more >English – Page 2 – Bruno Sonnino
There are some good reasons for that: x:Bind is resolved at compile time, while Binding is resolved at runtime, so it should make...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No that reference from the PR was just me wanting to make sure that it wasn’t the same issue as this issue.
Since I have not had feedback on this issue or the reported issue in the VS Dev Community, I assume this issue is not fixed.
Issue is fixed, this issue can be closed.