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

Build exception for certain string resources. #455

Closed
yowl opened this issue Dec 19, 2018 · 0 comments · Fixed by #457
Closed

Build exception for certain string resources. #455

yowl opened this issue Dec 19, 2018 · 0 comments · Fixed by #457
Labels
kind/bug Something isn't working

Comments

@yowl
Copy link
Contributor

yowl commented Dec 19, 2018

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

XamlGeneration fails for ResourceDictionary which contains
<System:String x:Key="shortDateFormatString">{0:d}</System:String>
Exception is

1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error : Generation failed for Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGenerator. System.AggregateException: One or more errors occurred. ---> System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.Extensions.IndentedStringBuilder.AppendFormat(IFormatProvider formatProvider, String pattern, Object[] replacements)
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.Extensions.IndentedStringBuilderExtensions.AppendFormatInvariant(IIndentedStringBuilder builder, String pattern, Object[] replacements)
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.UI.SourceGenerators.XamlGenerator.XamlFileGenerator.BuildChild(IIndentedStringBuilder writer, XamlMemberDefinition owner, XamlObjectDefinition xamlObjectDefinition) in D:\a\1\s\src\SourceGenerators\Uno.UI.SourceGenerators\XamlGenerator\XamlFileGenerator.cs:line 3670
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.UI.SourceGenerators.XamlGenerator.XamlFileGenerator.BuildKeyedStaticResources(IIndentedStringBuilder writer, Boolean isGlobalResources, IEnumerable`1 keyedResources) in D:\a\1\s\src\SourceGenerators\Uno.UI.SourceGenerators\XamlGenerator\XamlFileGenerator.cs:line 886
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.UI.SourceGenerators.XamlGenerator.XamlFileGenerator.BuildResourceDictionary(IIndentedStringBuilder writer, XamlObjectDefinition topLevelControl) in D:\a\1\s\src\SourceGenerators\Uno.UI.SourceGenerators\XamlGenerator\XamlFileGenerator.cs:line 596
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.UI.SourceGenerators.XamlGenerator.XamlFileGenerator.InnerGenerateFile() in D:\a\1\s\src\SourceGenerators\Uno.UI.SourceGenerators\XamlGenerator\XamlFileGenerator.cs:line 232
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.UI.SourceGenerators.XamlGenerator.XamlFileGenerator.GenerateFile() in D:\a\1\s\src\SourceGenerators\Uno.UI.SourceGenerators\XamlGenerator\XamlFileGenerator.cs:line 181
1>C:\Users\x\.nuget\packages\uno.sourcegenerationtasks\1.28.0\build\net45\Uno.SourceGenerationTasks.targets(100,4): error :    at Uno.UI.SourceGenerators.XamlGenerator.XamlCodeGeneration.<>c__DisplayClass20_0.<Generate>b__0(XamlFileDefinition file) in D:\a\1\s\src\SourceGenerators\Uno.UI.SourceGenerators\XamlGenerator\XamlCodeGeneration.cs:line 149

Expected behavior

This type of resource should be allowed to enhance compatibility with UWP

Minimal reproduction of the problem with instructions

Download the repo at https://github.com/yowl/UnoStandardRefTest/tree/FormatException and attempt to build the UnoLib project

Environment

Nuget Package: Uno.UI

Package Version(s): 1.42.0

Affected platform(s):
- [ ] iOS
- [ ] Android
- [ ] WebAssembly
- [x ] Windows
- [ ] Build tasks

Visual Studio
- [x ] 2017 (version: 15.9.4)
- [ ] 2017 Preview (version: )
- [ ] for Mac (version: )

Relevant plugins
- [ ] Resharper (version: )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants