Xamarin WebView-剃须刀中没有Intellisense [英] Xamarin WebView - No Intellisense in razor
问题描述
我正在尝试xamarin webView,您可以在其中使用razor-view作为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?
代码可以工作并构建,但是当我需要剃须刀中的模型时,intellisense将无法工作:
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安装路径)\ Common7 \ IDE \ Extensions \ Xamarin \ Xamarin \ 3.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)\Common7\IDE\Extensions\Xamarin\Xamarin\3.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.
删除您的解决方案用户首选项文件:(解决方案名称).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-剃须刀中没有Intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!