Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Adding AspnetCore.MVC in old class library is not working

$
0
0

Hi

We have .net 4.0 MVC 4 website so now we are converting it to MVC Core 1.1(.net std)

It has some old class libraries also.So I created only web project as 'Asp.net Core Web Application(.Net framework)' and other class libraries kept as it is.

So now when i open web project file it has targetframework version V4.6.1 so i made other class library version also V4.6.1 and we need Microsoft.Aspnetcore.MVC to be installed in one of the class library, i did that using Nuget for that project also and its working.

But i copied this project to one my colleagues machine.There he has two .net core versions 1.1 and 2.0 also..net core 2.0 he installed using SDK and runtime. So when he is installing AspnetCore.MVC using Nuget for that class library it's successful but when he is tring to add namespace Microsoft.AspnetCore.Mvc in one of it's class file, till Microsoft.AspnetCore its coming but .Mvc is not coming. We tried many things.Like un-install and again install AspnetCore.Mvc package but still its not working.

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

Can you please tell what is this issue and how to solve this? 

Also can you please confirm the way we converted class libaries by changing only TargetFramework is it right and will it work with Core 2.0 also?

Thanks,

Ashvini Awaskar


Viewing all articles
Browse latest Browse all 9386

Trending Articles