Intellisense errors in Xamarin WebView Project

2019-07-21 20:16发布

Intellisense does not work in Razor Files (.cshtml) in a Xamarin Mono.Android Project (e.g. your RazorTodo or in VS2017: New Project -> Choose Visual C# -> WebView-App (Android))

Compilation is fine, but I am getting reference errors (Intellisense only).

The type or namespace name 'Linq' does not exist in the namespace 'System' 
The type or namespace name 'Helpers' does not exist in the namespace 'System.Web'
The type or namespace name 'WebPages' does not exist in the namespace 'System.Web'

There is no System.Web.dll in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\

I just wanted to know if this is expected behavior?

I will provide further Screenshots or info if required. Thank you for your support.


In addition I cannot compile the project. There are errors in the processed file (.cs) of my Razor view (.cshtml).

Name "Href" is not found in current context

What is wrong here?

1条回答
干净又极端
2楼-- · 2019-07-21 20:46

When you are referencing libraries in .cshtml pages make sure that you are adding '@' before you reference the library.

-Example:

@using System;
@using System.Collections.Generic;
@using System.Web;
查看更多
登录 后发表回答