Closed mzajkowski closed 7 years ago
Can you try setting the Umbraco.ModelsBuilder.LanguageVersion
appSetting to "CSharp6" as per https://github.com/zpqrtbnk/Zbu.ModelsBuilder/wiki/Install-And-Configure? IIRC by default we only support C# 5.
Arghhh, sure. Missed it. It works. Thanks @zpqrtbnk!
Steps to reproduce the problem:
Result of above steps:
Failed to build models. Feature 'expression-bodied property' is not available in C# 5. Please use language version 6 or greater.
at Umbraco.ModelsBuilder.Building.Compiler.ThrowExceptionFromDiagnostic(String path, String code, Diagnostic diagnostic) in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Building\Compiler.cs:line 161 at Umbraco.ModelsBuilder.Building.Compiler.<>c__DisplayClass12_0.b__0(KeyValuePair
2 x) in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Building\Compiler.cs:line 50 at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable
1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Umbraco.ModelsBuilder.Building.Compiler.GetCompilation(String assemblyName, IDictionary
2 files, SyntaxTree[]& trees) in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Building\Compiler.cs:line 46 at Umbraco.ModelsBuilder.Building.CodeParser.Parse(IDictionary2 files, IEnumerable
1 references) in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Building\CodeParser.cs:line 38 at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.GenerateModels(String modelsDirectory, String bin) in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\ModelsBuilderBackOfficeController.cs:line 108 at Umbraco.ModelsBuilder.Umbraco.ModelsBuilderBackOfficeController.BuildModels() in C:\Users\Stéphane\Documents\Development\Umbraco\Zbu\Zbu.ModelsBuilder\Umbraco.ModelsBuilder\Umbraco\ModelsBuilderBackOfficeController.cs:line 35Tried workarounds / fixes: