Skip to content

Instantly share code, notes, and snippets.

@molaie
Created January 13, 2018 13:01
Show Gist options
  • Save molaie/788cb0279498c7efbbb4b751241d8896 to your computer and use it in GitHub Desktop.
Save molaie/788cb0279498c7efbbb4b751241d8896 to your computer and use it in GitHub Desktop.

An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately. Generated Code One or more compilation references are missing. Ensure that your project is referencing 'Microsoft.NET.Sdk.Web' and the 'PreserveCompilationContext' property is not set to false.

The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Modules/Core/Views/Home/Index.cshtml", typeof(AspNetCore._Modules_Core_Views_Home_Index_cshtml))]

Predefined type 'System.String' is not defined or imported

[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Modules/Core/Views/Home/Index.cshtml", typeof(AspNetCore._Modules_Core_Views_Home_Index_cshtml))]

Predefined type 'System.Type' is not defined or imported

[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Modules/Core/Views/Home/Index.cshtml", typeof(AspNetCore._Modules_Core_Views_Home_Index_cshtml))]

Predefined type 'System.Void' is not defined or imported

[assembly:global::Microsoft.AspNetCore.Mvc.Razor.Compilation.RazorViewAttribute(@"/Modules/Core/Views/Home/Index.cshtml", typeof(AspNetCore._Modules_Core_Views_Home_Index_cshtml))]

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)

    using System;

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)

    using System.Collections.Generic;

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)

    using System.Linq;

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)

    using System.Threading.Tasks;

The type or namespace name 'ViewFeatures' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)

    using Microsoft.AspNetCore.Mvc.ViewFeatures;

Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference?

    public class _Modules_Core_Views_Home_Index_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>

Predefined type 'System.Boolean' is not defined or imported

    public class _Modules_Core_Views_Home_Index_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

    public class _Modules_Core_Views_Home_Index_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>

The return type of an async method must be void, Task or Task

        public async override global::System.Threading.Tasks.Task ExecuteAsync()

The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?)

        public async override global::System.Threading.Tasks.Task ExecuteAsync()

The type or namespace name 'ViewFeatures' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)

        public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }

Predefined type 'System.Void' is not defined or imported

        public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }

The type or namespace name 'IUrlHelper' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)

        public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }

Predefined type 'System.Void' is not defined or imported

        public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }

The type or namespace name 'IViewComponentHelper' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)

        public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }

Predefined type 'System.Void' is not defined or imported

        public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }

The type or namespace name 'IJsonHelper' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.Rendering' (are you missing an assembly reference?)

        public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }

Predefined type 'System.Void' is not defined or imported

        public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }

The type or namespace name 'IHtmlHelper<>' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.Rendering' (are you missing an assembly reference?)

        public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

        public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }

Predefined type 'System.Object' is not defined or imported

        public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }

Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference?

        public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }

Predefined type 'System.Boolean' is not defined or imported

        public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }

Predefined type 'System.Void' is not defined or imported

        public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<dynamic> Html { get; private set; }

'_Modules_Core_Views_Home_Index_cshtml.ExecuteAsync()': return type must be 'Task' to match overridden member 'RazorPageBase.ExecuteAsync()'

        public async override global::System.Threading.Tasks.Task ExecuteAsync()

The type 'Task' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

        public async override global::System.Threading.Tasks.Task ExecuteAsync()

The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

Predefined type 'System.Void' is not defined or imported

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

Predefined type 'System.Void' is not defined or imported

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

Predefined type 'System.Void' is not defined or imported

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

Predefined type 'System.Void' is not defined or imported

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

Predefined type 'System.Void' is not defined or imported

        [global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            BeginContext(45, 5814, true);

Predefined type 'System.Object' is not defined or imported

            BeginContext(45, 5814, true);

Predefined type 'System.Int32' is not defined or imported

            BeginContext(45, 5814, true);

Predefined type 'System.Int32' is not defined or imported

            BeginContext(45, 5814, true);

Predefined type 'System.Boolean' is not defined or imported

            BeginContext(45, 5814, true);

Predefined type 'System.Void' is not defined or imported

            BeginContext(45, 5814, true);

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            WriteLiteral(@"

Predefined type 'System.Object' is not defined or imported

            WriteLiteral(@"

Predefined type 'System.String' is not defined or imported

            WriteLiteral(@"
<div id=""myCarousel"" class=""carousel slide"" data-ride=""carousel"" data-interval=""6000"">
    <ol class=""carousel-indicators"">
        <li data-target=""#myCarousel"" data-slide-to=""0"" class=""active""></li>
        <li data-target=""#myCarousel"" data-slide-to=""1""></li>
        <li data-target=""#myCarousel"" data-slide-to=""2""></li>
        <li data-target=""#myCarousel"" data-slide-to=""3""></li>
    </ol>
    <div class=""carousel-inner"" role=""listbox"">
        <div class=""item active"">
            <img src=""~/images/banner1.svg"" alt=""ASP.NET"" class=""img-responsive"" />
            <div class=""carousel-caption"" role=""option"">
                <p>
                    Learn how to build ASP.NET apps that can run anywhere.
                    <a class=""btn btn-default"" href=""http://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409"">
                        Learn More
                    </a>
                </p>
            </div>
        </div>
        <div class=""item"">
            <img src=""~/images/b");

Predefined type 'System.Void' is not defined or imported

            WriteLiteral(@"

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            WriteLiteral(@"anner2.svg"" alt=""Visual Studio"" class=""img-responsive"" />

Predefined type 'System.Object' is not defined or imported

            WriteLiteral(@"anner2.svg"" alt=""Visual Studio"" class=""img-responsive"" />

Predefined type 'System.String' is not defined or imported

            WriteLiteral(@"anner2.svg"" alt=""Visual Studio"" class=""img-responsive"" />
            <div class=""carousel-caption"" role=""option"">
                <p>
                    There are powerful new features in Visual Studio for building modern web apps.
                    <a class=""btn btn-default"" href=""http://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409"">
                        Learn More
                    </a>
                </p>
            </div>
        </div>
        <div class=""item"">
            <img src=""~/images/banner3.svg"" alt=""Package Management"" class=""img-responsive"" />
            <div class=""carousel-caption"" role=""option"">
                <p>
                    Bring in libraries from NuGet, Bower, and npm, and automate tasks using Grunt or Gulp.
                    <a class=""btn btn-default"" href=""http://go.microsoft.com/fwlink/?LinkID=525029&clcid=0x409"">
                        Learn More
                    </a>
                </p>
            </div>
        </div>
       ");

Predefined type 'System.Void' is not defined or imported

            WriteLiteral(@"anner2.svg"" alt=""Visual Studio"" class=""img-responsive"" />

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            WriteLiteral(@" <div class=""item"">

Predefined type 'System.Object' is not defined or imported

            WriteLiteral(@" <div class=""item"">

Predefined type 'System.String' is not defined or imported

            WriteLiteral(@" <div class=""item"">
            <img src=""~/images/banner4.svg"" alt=""Microsoft Azure"" class=""img-responsive"" />
            <div class=""carousel-caption"" role=""option"">
                <p>
                    Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
                    <a class=""btn btn-default"" href=""http://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409"">
                        Learn More
                    </a>
                </p>
            </div>
        </div>
    </div>
    <a class=""left carousel-control"" href=""#myCarousel"" role=""button"" data-slide=""prev"">
        <span class=""glyphicon glyphicon-chevron-left"" aria-hidden=""true""></span>
        <span class=""sr-only"">Previous</span>
    </a>
    <a class=""right carousel-control"" href=""#myCarousel"" role=""button"" data-slide=""next"">
        <span class=""glyphicon glyphicon-chevron-right"" aria-hidden=""true""></span>
        <span class=""sr-only"">Next</span>
    </a>
</div>
<div");

Predefined type 'System.Void' is not defined or imported

            WriteLiteral(@" <div class=""item"">

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            WriteLiteral(@" class=""row"">

Predefined type 'System.Object' is not defined or imported

            WriteLiteral(@" class=""row"">

Predefined type 'System.String' is not defined or imported

            WriteLiteral(@" class=""row"">
    <div class=""col-md-3"">
        <h2>Application uses</h2>
        <ul>
            <li>Sample pages using ASP.NET Core MVC</li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=518007"">Gulp</a> and <a href=""http://go.microsoft.com/fwlink/?LinkId=518004"">Bower</a> for managing client-side libraries</li>
            <li>Theming using <a href=""http://go.microsoft.com/fwlink/?LinkID=398939"">Bootstrap</a></li>
        </ul>
    </div>
    <div class=""col-md-3"">
        <h2>How to</h2>
        <ul>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkID=398600"">Add a Controller and View</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkID=699562"">Add an appsetting in config and access it in app.</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699315"">Manage User Secrets using Secret Manager.</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699316"">Use logging to log a message.</a></li>
      ");

Predefined type 'System.Void' is not defined or imported

            WriteLiteral(@" class=""row"">

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            WriteLiteral(@"      <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699317"">Add packages using NuGet.</a></li>

Predefined type 'System.Object' is not defined or imported

            WriteLiteral(@"      <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699317"">Add packages using NuGet.</a></li>

Predefined type 'System.String' is not defined or imported

            WriteLiteral(@"      <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699317"">Add packages using NuGet.</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699318"">Add client packages using Bower.</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699319"">Target development, staging or production environment.</a></li>
        </ul>
    </div>
    <div class=""col-md-3"">
        <h2>Overview</h2>
        <ul>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=518008"">Conceptual overview of what is ASP.NET Core</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699320"">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=398602"">Working with Data</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkId=398603"">Security</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkID=699321"">Client side development</a></li>
        ");

Predefined type 'System.Void' is not defined or imported

            WriteLiteral(@"      <li><a href=""http://go.microsoft.com/fwlink/?LinkId=699317"">Add packages using NuGet.</a></li>

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            WriteLiteral(@"    <li><a href=""http://go.microsoft.com/fwlink/?LinkID=699322"">Develop on different platforms</a></li>

Predefined type 'System.Object' is not defined or imported

            WriteLiteral(@"    <li><a href=""http://go.microsoft.com/fwlink/?LinkID=699322"">Develop on different platforms</a></li>

Predefined type 'System.String' is not defined or imported

            WriteLiteral(@"    <li><a href=""http://go.microsoft.com/fwlink/?LinkID=699322"">Develop on different platforms</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkID=699323"">Read more on the documentation site</a></li>
        </ul>
    </div>
    <div class=""col-md-3"">
        <h2>Run & Deploy</h2>
        <ul>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkID=517851"">Run your app</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkID=517853"">Run tools such as EF migrations and more</a></li>
            <li><a href=""http://go.microsoft.com/fwlink/?LinkID=398609"">Publish to Microsoft Azure Web Apps</a></li>
        </ul>
    </div>
</div>
");

Predefined type 'System.Void' is not defined or imported

            WriteLiteral(@"    <li><a href=""http://go.microsoft.com/fwlink/?LinkID=699322"">Develop on different platforms</a></li>

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

            EndContext();

Predefined type 'System.Object' is not defined or imported

            EndContext();

Predefined type 'System.Void' is not defined or imported

            EndContext();

'_Modules_Core_Views_Home_Index_cshtml.ExecuteAsync()': not all code paths return a value

        public async override global::System.Threading.Tasks.Task ExecuteAsync()

Predefined type 'System.Void' is not defined or imported

        public class _Modules_Core_Views_Home_Index_cshtml : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic>

D:\Projects\Yooshina\Yooshina.Host\Modules\Core\Views_ViewImports.cshtml One or more compilation references are missing. Ensure that your project is referencing 'Microsoft.NET.Sdk.Web' and the 'PreserveCompilationContext' property is not set to false.

The type or namespace name 'Modular' could not be found (are you missing a using directive or an assembly reference?)

@using Modular.Modules.Core

The type or namespace name 'Modular' could not be found (are you missing a using directive or an assembly reference?)

@using Modular.Modules.Core.Models

The type or namespace name 'Modular' could not be found (are you missing a using directive or an assembly reference?)

@using Modular.Modules.Core.Models.AccountViewModels

The type or namespace name 'Modular' could not be found (are you missing a using directive or an assembly reference?)

@using Modular.Modules.Core.Models.ManageViewModels

The type or namespace name 'Identity' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?)

    @using Microsoft.AspNetCore.Identity

D:\Projects\Yooshina\Yooshina.Host\Modules\Core\Views\Home\Index.cshtml

The type 'ViewDataDictionary<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.AspNetCore.Mvc.ViewFeatures, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.

    ViewData["Title"] = "Home Page";

Predefined type 'System.String' is not defined or imported

    ViewData["Title"] = "Home Page";

Predefined type 'System.String' is not defined or imported

        ViewData["Title"] = "Home Page";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment