Skip to content

Conversation

@pranavkm
Copy link
Contributor

I spoke to Taylor offline and it looks like we can get away without creating a new RazorConfiguration or extension for MVC. I did some testing with MVC 5.0 and 3.1 apps, and tooling appears to work correctly.

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Jun 26, 2020
@pranavkm pranavkm added this to the 5.0.0-preview7 milestone Jun 26, 2020
var result = await DotnetMSBuild(
"Build",
"/p:UseRazorBuildServer=false /p:RazorLangVersion=5.0",
"/p:UseRazorBuildServer=false /p:RazorLangVersion=6.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor point, but why keep rolling this forward each time? What about:

Suggested change
"/p:UseRazorBuildServer=false /p:RazorLangVersion=6.0",
"/p:UseRazorBuildServer=false /p:RazorLangVersion=99999.0",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really know why this test is authored this way. @NTaylorMullen \ @ajaybhargavb ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason. I was probably being dumb.

Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for sorting this out, @pranavkm!

Assert.BuildOutputContainsLine(
result,
$"Invalid option 5.0 for Razor language version --version; must be Latest or a valid version in range 1.0 to 3.0.");
$"Invalid option 99.0 for Razor language version --version; must be Latest or a valid version in range 1.0 to 5.0.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or a valid version in range 1.0 to 5.0.

This is a confusing statement indicating 4.0 might be valid. Could we rephrase this somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions? I would note that none of the point values are supported. (e.g. 3.1 is not valid).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is easy to do, we could just list all the possible supported values. Just like how dotnet lists all the available SDKs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what the compiler does:

Error CS1617 Invalid option '9.0' for /langversion. Use '/langversion:?' to list supported values

It's not really easy to find this. I'm kinda tempted to leave these be. AFAIK, nobody configures these. Plus the language versions are precariously tied to the runtime version that setting this is always going to get you in trouble.

@mkArtakMSFT mkArtakMSFT merged commit 23a3e84 into release/5.0-preview7 Jun 27, 2020
@mkArtakMSFT mkArtakMSFT deleted the prkrishn/razor-lang-version branch June 27, 2020 00:49
version = Experimental;
return true;
}
else if (languageVersion == "5.0")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants