asp.net-core-1.1

ASP.NET Core Scaffolding does not work in VS 2017

余生长醉 提交于 2020-12-08 05:36:47
问题 I have a beginner ASP.NET Core project in Visual Studio 2017, and I am at the scaffolding step of the HelloWorld. The Scaffolding does not work, I tested on a first computer, then at a second one... when I try to generate a controller with views , it gives the following error on the first machine: Microsoft Visual Studio Error There was an error running the selected code generator: 'Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio

ASP.NET Core Scaffolding does not work in VS 2017

我与影子孤独终老i 提交于 2020-12-08 05:36:15
问题 I have a beginner ASP.NET Core project in Visual Studio 2017, and I am at the scaffolding step of the HelloWorld. The Scaffolding does not work, I tested on a first computer, then at a second one... when I try to generate a controller with views , it gives the following error on the first machine: Microsoft Visual Studio Error There was an error running the selected code generator: 'Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio

View Component as a Tag Helper does not get Invoked

£可爱£侵袭症+ 提交于 2020-05-26 02:36:21
问题 Invoking a View Component as a Tag Helper was introduced in ASP.NET Core 1.1. (See “Invoking a view component as a Tag Helper”). But the following only returns the Test for VC part of the view. It seems that <vc:annual-orders>…</vc:annual-orders> part does not get invoked at all. Views\Shared\Components\AnnualOrders\Default.cshtml : @{ Layout = ""; } <div>Test for VC</div> <div> <vc:annual-orders> </vc:annual-orders> </div> myProj\ViewComponents\AnnualOrdersViewComponent.cs : public class

'The string argument 'migrationId' cannot be empty.'

别说谁变了你拦得住时间么 提交于 2020-05-24 05:52:45
问题 Blocked on a weird error. I am working in an asp.net core web application, and using EF core 1.1.0 in it. EF database migration is throwing error 'The string argument 'migrationId' cannot be empty.' when trying to execute below command dbcontext.Database.Migrate(); Performed accepted answer from the the link but it did not solved my issue. Uninstall donet 2.0.0, installed 1.1.0 and restarted PC. Still i am getting the same error. Can anyone please help me on this. 回答1: When you have

ASP.NET Core Identity impersonate specific user

淺唱寂寞╮ 提交于 2020-05-08 04:29:59
问题 Let's say I have the following roles: Admin User I want Admin role to impersonate specific user account with User role, but without knowing that specific user account's password. Admin should be able to impersonate any user from the application and be able to browse the application as the user himself. I found a link where this is actually implemented in ASP.NET MVC 4.6, but having a little headaches while converting this to Core version. Mostly because of the last line of code in the link

ASP.NET Core Identity impersonate specific user

淺唱寂寞╮ 提交于 2020-05-08 04:28:08
问题 Let's say I have the following roles: Admin User I want Admin role to impersonate specific user account with User role, but without knowing that specific user account's password. Admin should be able to impersonate any user from the application and be able to browse the application as the user himself. I found a link where this is actually implemented in ASP.NET MVC 4.6, but having a little headaches while converting this to Core version. Mostly because of the last line of code in the link

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

老子叫甜甜 提交于 2020-03-18 03:13:43
问题 I'm trying to upgrade the following template project to ASP.NET Core 1.1: https://github.com/wilanbigay/aspnet-core-aurelia-typescript-starter After running dotnet migrate the project.json file has been dropped in favour of the new csproj file. Using Visual Studio Code and the Nuget4Code extension I've upgraded all components to ASP.NET Core 1.1. The CsProj now contains entries like so: <ItemGroup> <PackageReference Include="Microsoft.NET.Sdk"> <Version>1.0.0-alpha-20161104-2</Version>

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

ぃ、小莉子 提交于 2020-03-18 03:12:27
问题 I'm trying to upgrade the following template project to ASP.NET Core 1.1: https://github.com/wilanbigay/aspnet-core-aurelia-typescript-starter After running dotnet migrate the project.json file has been dropped in favour of the new csproj file. Using Visual Studio Code and the Nuget4Code extension I've upgraded all components to ASP.NET Core 1.1. The CsProj now contains entries like so: <ItemGroup> <PackageReference Include="Microsoft.NET.Sdk"> <Version>1.0.0-alpha-20161104-2</Version>

asp.net core build error : 'HttpRequestMessageExtensions'

核能气质少年 提交于 2020-01-15 03:06:10
问题 Using ASPNet Core 1.1 Web API template and trying to create a response on Post. Getting the below error while building the project. Thanks for your help ! Controllers\MessagesController.cs(37,28,37,72): error CS0433: The type 'HttpRequestMessageExtensions' exists in both 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 回答1: You should remove reference to

asp.net core build error : 'HttpRequestMessageExtensions'

[亡魂溺海] 提交于 2020-01-15 03:04:08
问题 Using ASPNet Core 1.1 Web API template and trying to create a response on Post. Getting the below error while building the project. Thanks for your help ! Controllers\MessagesController.cs(37,28,37,72): error CS0433: The type 'HttpRequestMessageExtensions' exists in both 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 回答1: You should remove reference to