0

Fresh WebViewApp (Android) Template out of the box shows Intellisense Errors (see below). Why does VS2017 not find the references? Do the referenced dlls even contain the required namespaces? How can I solve this issue?

Basic demo

Official Xamarain RazorTodo Sample also has same Intellisense Errors

Details below...


Errors occur only in RazorView.cshtml (only when opened)

Error CS0234 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)

Error CS0234 The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 

Error CS0234 The type or namespace name 'WebPages' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 

Error CS0115 "_Page_Views_RazorView_cshtml.Execute()": No suitable method found to override.

Out of the box, there are referenced:

Mono.Android
mscorlib
System
System.Core
System.Web.Services
System.Xml
System.Xml.Linq

Path of reference assemblies are as follows:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll

Path of assembly Mono.Android is:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v7.1\Mono.Android.dll

Target Framework (in Projekt Properties):

Use newest platform (Android 7.1 (Nougat))

Versions:

  • Microsoft Visual Studio Community 2017, Version 15.3.5
  • Also Visual Studio Community 2015
  • Microsoft .NET Framework, Version 4.6.01038
  • Mono Debugging for Visual Studio 4.6.8-pre (ec7034f)
  • NuGet-Paket-Manager 3.5.0
  • Xamarin 4.6.0.299 (b63523e27)
  • Xamarin.Android 7.4.0.21 (2851083)

Installed Android SDK:

  • Android 7.1.1 (API 25): SDK Platform, Sources for Android SDK
  • Android 7.0 (API 24): SDK Platform, Sources for Android SDK, Google APIs
  • Android 5.0.1 (API 21): SDK Platform
  • Android 4.4.2 (API 19): SDK Platform, Google APIs
  • Extras: Android Support Repository Rev. 47

----UPDATE----

I updated my question. Project does compile BUT I cannot work because I get Intellisense Errors and no syntax highlighting ;)

I tested out IntelliSense in Razor files (.cshtml) stopped working and Xamarin WebView - No Intellisense in razor

So I cleared ComponentModelCache and deleted RazorTemplatePreprocessor in registry.

----UPDATE 2----

I INSTALLED VS2017. STILL SAME ERRORS. THIS $§%& SHOULD WORK RIGHT OUT OF THE BOX!!! WHAT AM I DOING WRONG???

TrantSteel
  • 225
  • 1
  • 2
  • 10
  • Could you please share a basic demo to reproduce this problem? It works fine on my side. – York Shen Sep 08 '17 at 02:53
  • @YorkShen-MSFT Open Visual Studio 2015 Community Edition -> New Project -> Choose Visual C# -> WebView-App (Android) -> Default Name, Path and Projectsolutionname -> OK -> In the Project Solution Explorer open Folder "Views" and open RazorView.cshtml – TrantSteel Sep 08 '17 at 19:55
  • @YorkShen-MSFT I tried this with choosing .NET Framework 3.5 and newest available 4.6.1 in the "New Project Dialog" – TrantSteel Sep 08 '17 at 20:08
  • sorry for late, I test your project, it works fine, I use Visual Studio 2017, deploy on Android 7.0, you could try using VS 2017. – York Shen Sep 20 '17 at 09:41
  • @YorkShen-MSFT Thanks for your answer. I updated my question. – TrantSteel Sep 20 '17 at 19:41
  • Sorry for late, please refer to : https://stackoverflow.com/questions/46508002/xamarin-razor-webview-template-missing-reference/46556217#46556217 – York Shen Oct 04 '17 at 07:05

0 Answers0