Xamarin WebView - 剃刀中没有智能感知 [英] Xamarin WebView - No Intellisense in razor

查看:22
本文介绍了Xamarin WebView - 剃刀中没有智能感知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 xamarin webView,您可以在其中使用剃刀视图作为 UI.但是 C# 代码的智能感知不起作用.

I'm trying out xamarin webView where you can use a razor-view as the UI. But the intellisense for the C#-code doesn't work.

这是一个已知的错误还是我遗漏了什么?我需要在 webConfig 文件中配置它吗?

Is this a known bug or am I missing something? Do I need to configure it in the webConfig-file?

代码可以运行并构建,但是当我需要在 razor 智能感知中的模型时将无法运行:

The code works and builds, but when I need a model in razor intellisense won't work:

@model TestProject.Models.Model1

<html>
<head>
    <title>testProject</title>
</head>
    <body>
        @Model.Text
    </body>
</html> 

在我写 @model@Model 的地方,它只是说无法解析符号..."

Where I write @model and @Model , it just says 'Cannot resolve symbol...'

怎么办?

推荐答案

关闭 Visual Studio 的所有实例.

Close all instances of Visual Studio.

进入你的(Visual Studio 安装路径)Common7IDEExtensionsXamarinXamarin3.9.483.0"并将三个文件:System.Web.Razor.dll、System.Web.WebPages.dll 和 System.Web.WebPages.Deployment.dll 重命名为 System.Web.Razor.bad、System.Web.WebPages.bad 和System.Web.WebPages.Deployment.bad.

Go into your "(Visual Studio install path)Common7IDEExtensionsXamarinXamarin3.9.483.0" And rename the three files: System.Web.Razor.dll, System.Web.WebPages.dll, and System.Web.WebPages.Deployment.dll into System.Web.Razor.bad, System.Web.WebPages.bad, and System.Web.WebPages.Deployment.bad.

使用注册表编辑器搜索您的注册表并删除RazorTemplatePreprocessor"键.

Search your registry with the registry editor and remove the "RazorTemplatePreprocessor" key.

删除您的解决方案用户首选项文件:(Solution Name).suo

Delete your solution user preferences files: (Solution Name).suo

当您启动 Visual Studio 时,您将再次拥有自己的智能感知!

When you start up Visual Studio, you will have your razor intellisense again!

这篇关于Xamarin WebView - 剃刀中没有智能感知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆