Intellisense is not working for View Template file. Yes I am inheriting from TemplatePage
See original GitHub issueDescribe the bug Intellisense is not working for View Template file. Yes I am inheriting from TemplatePage
To Reproduce Create a Project with the following
Project file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
</PropertyGroup>
<ItemGroup>
<None Remove="TestView.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="TestView.cshtml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="RazorLight" Version="2.0.0-beta1" />
</ItemGroup>
</Project>
TestView.cshtml
@using QuestionRazorLight
@using RazorLight
@inherits TemplatePage<TestViewModel>
<table id="myTable" class="table" cellspacing="0">
<thead>
<tr>
item1
</tr>
<tr>
item2
</tr>
</thead>
<tbody>
@foreach (var item in Model.listOfStuff)
{
<tr>
item.item1
</tr>
<tr>
item.item2
</tr>
}
</tbody>
</table>
TestViewModel.cs
using System;
using System.Collections.Generic;
using System.Text;
Program.cs
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using RazorLight;
namespace QuestionRazorLight
{
class Program
{
static void Main(string[] args)
{
var viewmodel = new TestViewModel
{
listOfStuff = new List<(string, string)>() { ("Blah1","blah1"), ("Blah2", "blah2") }
};
var engine = new RazorLightEngineBuilder()
.UseFilesystemProject(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location))
.UseMemoryCachingProvider()
.Build();
string reportAsHTML = engine.CompileRenderAsync($"{Path.DirectorySeparatorChar}TestView.cshtml", viewmodel).Result;
}
}
}
namespace QuestionRazorLight
{
public class TestViewModel
{
public IList<(string,string)> listOfStuff { get; set; }
}
}
Expected behavior I expect there not to be any syntax errors about missing AspNetCore assemblies
Information:
- OS: Windows 10 1809
- Visual Studio Community 2017 (15.9.4)
- Platform .NET Core 2.1
- RazorLight version 2.0-beta1
Additional Information This will compile and run but I can’t figure out how to make the syntax errors go away.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
c++ - Visual Studio Intellisense not working when inheriting ...
Visual Studio Intellisense not working when inheriting from template class. The code compiles and runs. But in void C<T>::test() , when I tried ......
Read more >Live templates not shown while using VS intellisense - YouTrack
Resharper Live Templates does not show up using the Visual Studio intellisense, the Live templates indeed work, but to invoke a Live template...
Read more >Intellisense Not working - Developer Community
Tried to continue working on my ARM Templates and create a new resource. Intellisense was SO SLOW that VS was not responding for...
Read more >EPiServer Web Controls
Template class used by FileTree to display files. FileTree. Displays a file tree from ... a seven level deep inheritance chain: (not shown...
Read more >Flare Touring the Workspace Guide
Non -Topic File Type. Recommended Default Folder in Content Explorer. Table Stylesheet. Resources > TableStyles. Template Page. Resources > TemplatePages.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can try to add PackageReferences to your Project file ```
@TheColonel2688
Add ‘Web’ to the end of your project sdk, that wakes the intellisense up.
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <ApplicationIcon /> <OutputType>Library</OutputType> <StartupObject />