Pasting bad code over bad code crashes VS
victorhurdugaci opened this issue · comments
Victor Hurdugaci commented
-
Create a new web application (no authentication)
-
Open the
Home/Index
view and paste this code (ignore any compilation errors):@using BuildDashboard.Server.Models.Dashboard @using SectionLayout = BuildDashboard.Server.Models.Dashboard.Layout @model SectionTile @{ const int MinGridItemSize = 2; const int GridSpaces = 12; const int MaxItemsPerRow = GridSpaces / MinGridItemSize; } <div class="page-header"> <h1>@Model.Title</h1> </div> @*@if (Model.Layout == SectionLayout.Normal) { foreach (var tile in Model.Tiles) { @await Component.InvokeAsync("Tile", new { tile }) } } else { var itemsPerRow = }*@
-
Save
-
Copy the code below
@using BuildDashboard.Server.Models.Dashboard @model SectionTile @{ const int GridSize = 12; var actualItemsPerRow = Model.ItemsPerRow; if (actualItemsPerRow < 1) { actualItemsPerRow = 1; } else if (actualItemsPerRow > 12) { actualItemsPerRow = 12; } while (GridSize % actualItemsPerRow != 0) { --actualItemsPerRow; } } <div class="page-header"> <h1>@Model.Title</h1> </div> <div>@actualItemsPerRow</div> <!--@*@if (Model.Layout == SectionLayout.Normal) { foreach (var tile in Model.Tiles) { @await Component.InvokeAsync("Tile", new { tile }) } } else { var itemsPerRow = }*@-->
-
Go back to the view
-
Select all
-
Paste
Result: VS crashes
VS version: 14.0.23107.0 D14REL
Tooling: 14.1.11116.0
Bill Hiebert commented
@victorhurdugaci - can you get dmp file?
Victor Hurdugaci commented
Sure, if you tell me how to do it :)
N. Taylor Mullen commented
Note: This probably should be moved to the aspnet/Tooling repo.
Eilon Lipton commented
@victorhurdugaci can you move to https://github.com/aspnet/Tooling/issues/ and close this?