简体   繁体   中英

upgrade asp.net core targeting framework 4.6.1 from vs2015 to vs2017 - One or more compilation references are missing

I have upgraded my asp.net core,using project.json and targeting .net framework 4.6.1 on visual studio 2015 to visual studio 2017.

I have multiple projects in the solution where the main application is referencing them by project reference(all of them target net461).

When running the application I get

One or more compilation references are missing. Possible causes include a missing 'preserveCompilationContext' property under 'buildOptions' in the application's project.json.

screenshot: 在此处输入图片说明

I have tried adding the true to all of the reference projects without luck.

Can anyone help? Thank you.

Look in your Login.cshtml file and ensure you give the fully qualified name to the model to find your LoginViewModel and inject your SignInManager. Something like this:

@model company.Web.Models.AccountViewModels.LoginViewModel

@inject Microsoft.AspNetCore.Identity.SignInManager SignInManager

That should allow the view to serve the page correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM