dotnet / dotnet/vscode-csharp

Fails to find symbol in cshtml while debugging

Open
#1,748 2 comments 0 reactions 0 assignees View on GitHub
Debugger OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

## Environment data

`dotnet --info` output:
```
.NET Command Line Tools (2.0.0)

Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
```

VS Code version: 1.15.1 (41abd21afdf7424c89319ee7cb0445cc6f376959)
C# Extension version: 1.12.1

## Steps to reproduce

Attempt to observer the value of `selectedModIds` in the below code:

```csharp
@{
ViewData["Title"] = "Maps";

var modIds = new[] { "RA", "TD", "TS" };

// Pretend this is bound to the frontend's state.
var selectedModIds = new[] { "any", "TS" };
}

@ViewData["Title"]


@ViewData["Message"]




Mod:

@foreach (var modId in modIds)
{
selected
}
}>@modId
}




```

## Expected behavior

Get `["any", "TS"]`.

## Actual behavior

Get `error CS0103: The name 'selectedModIds' does not exist in the current context`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.