android - Xamarin WebView 项目中的 Intellisense 错误

标签 android xamarin razor webview visual-studio-2017

Intellisense 在 Xamarin Mono.Android 项目(例如您的 RazorTodoVS2017:新建项目 -> 选择 V​​isual C# -> WebView-App (Android))

编译没问题,但出现引用错误(仅限 Intellisense)。

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'

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\下没有System.Web.dll

我只是想知道这是否是预期的行为?

如果需要,我会提供进一步的屏幕截图或信息。感谢您的支持。


此外,我无法编译该项目。我的 Razor View (.cshtml) 的已处理文件 (.cs) 中存在错误。

Name "Href" is not found in current context

这里有什么问题吗?

最佳答案

当您在.cshtml 页面 中引用库时,请确保在引用库之前添加'@'

-示例:

@using System;
@using System.Collections.Generic;
@using System.Web;

关于android - Xamarin WebView 项目中的 Intellisense 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46535174/

相关文章:

Android LiveWallpaper 选择器崩溃

MvvmCross:ShowViewModel 是否总是构造新实例?

ios - 如何清理自定义控件?

c# - Android Activity 的滑入/滑出动画。这个设置可以吗?

.net - 小数值显示为 0.00

android - 使用 google doc 在 android web View 中显示 .DOCX 文件给出错误

android - decodeStream 返回 null

android - ionic : Why the Android keyboard "next" button try to validate a form?

c# - 在 ASP.NET MVC [非静态] 中声明全局 Razor 页面变量

asp.net-mvc-3 - 需要帮助来区分 WebMatrix、ASP.NET 网页和 Razor 语法