The root cause here was that we weren't setting the language version in
MSBuild, which is only for the command line version.

(cherry picked from commit 319e31f71a150e9b0d91e724f0e358390caec4c2)
This commit is contained in:
Ryan Nowak 2018-06-07 11:56:09 -07:00
parent 34971c9569
commit 0fb47684c8
3 changed files with 19 additions and 1 deletions

View File

@ -14,6 +14,8 @@
<!-- Deactivates the Razor SDK's build-time compilation. We do our own -->
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorLangVersion>Experimental</RazorLangVersion>
<!--
This version is used to build our RazorConfiguration, and is hardcoded into the tools in VS. If you change
This to a value that doesn't match VS, then the Blazor Razor experience won't work for those documents.

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
@ -40,6 +40,17 @@ namespace Microsoft.AspNetCore.Blazor.E2ETest.Tests
Assert.Equal("Hello from TextOnlyComponent", appElement.Text);
}
// This verifies that we've correctly configured the Razor language version via MSBuild.
// See #974
[Fact]
public void CanRenderComponentWithDataDash()
{
var appElement = MountTestComponent<DataDashComponent>();
var element = appElement.FindElement(By.Id("cool_beans"));
Assert.Equal("17", element.GetAttribute("data-tab"));
Assert.Equal("17", element.Text);
}
[Fact]
public void CanRenderComponentWithAttributes()
{

View File

@ -0,0 +1,5 @@
<div id="cool_beans" data-tab="@TabId">@TabId</div>
@functions {
string TabId = "17";
}