Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
227 views
in Technique[技术] by (71.8m points)

c# - Xamarin WebView - No Intellisense in razor

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.

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

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> 

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

What to do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Close all instances of Visual Studio.

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.

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

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...