Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextBox throw an System.Windows.Markup.XamlParseException #1003

Closed
chenyj796 opened this issue Jun 18, 2019 · 3 comments
Closed

TextBox throw an System.Windows.Markup.XamlParseException #1003

chenyj796 opened this issue Jun 18, 2019 · 3 comments

Comments

@chenyj796
Copy link

chenyj796 commented Jun 18, 2019

  • .NET Core Version: (e.g. 3.0 Preview1, or daily build number, use dotnet --info)
    3.0.100-preview6-012264
  • Windows version: (winver)
    1803
  • Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes/No
    4.7.2 No
    3.0.100-preview5-011568 No
  • Visual Studio Version
    Community 2019 16.1.3

Problem description:

  1. Create a new WPF APP (.net core)
  2. In MainWindow.xaml, only add a TextBox in Grid:
<Window x:Class="WpfApp5.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp5"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <TextBox />
    </Grid>
</Window>

Actual behavior:
Debug the project, it throw an excaption:

System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message=“对类型“System.Windows.Controls.TextBox”的构造函数执行符合指定的绑定约束的调用时引发了异常。”,行号为“10”,行位置为“10”。
  Source=PresentationFramework
  StackTrace:
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at WpfApp4.MainWindow.InitializeComponent() in C:\Users\chenyj\source\repos\WpfApp4\MainWindow.xaml:line 1

内部异常 1:
ArgumentException: Requested value '删除' was not found.

Expected behavior:

Minimal repro:

@rladuca
Copy link
Member

rladuca commented Jun 18, 2019

@ryalanms This might be a dupe of loc issues.

@ryalanms
Copy link
Member

Yes, this is a fixed by #919 which is available in the nightly build. Thanks.

@grubioe grubioe closed this as completed Jun 19, 2019
@ryalanms
Copy link
Member

ryalanms commented Jun 19, 2019

To use Preview 6, add this to your project (.csproj) file:

<PropertyGroup>
  <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>

Otherwise, please use a nightly build. Thanks.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants