question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation errors in CustomerDetails.g.cs caused by x:Bind

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
hansmbakkercommented, Nov 13, 2018

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.

0reactions
hansmbakkercommented, Feb 18, 2019

Issue is fixed, this issue can be closed.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found