.net-core-rc2

How to fix intellisense with referenced netstandard1.5 library projects in Visual Studio 2015?

非 Y 不嫁゛ 提交于 2019-12-19 09:57:56
问题 I have four library projects that are all targeting the netstandard1.5 framework. Some of them depend on the other and the intellisense is working fine under those four projects. I am trying to use these libraries inside my ASP.NET netcoreapp1.0 project. But when I target the netcoreapp1.0 framework the types are not found (outlined red in visual studio). The project hower compiles and runs successfully. As soon as I switch to the netstandard1.5 framework inside my web api the types of the

How to fix intellisense with referenced netstandard1.5 library projects in Visual Studio 2015?

安稳与你 提交于 2019-12-19 09:57:09
问题 I have four library projects that are all targeting the netstandard1.5 framework. Some of them depend on the other and the intellisense is working fine under those four projects. I am trying to use these libraries inside my ASP.NET netcoreapp1.0 project. But when I target the netcoreapp1.0 framework the types are not found (outlined red in visual studio). The project hower compiles and runs successfully. As soon as I switch to the netstandard1.5 framework inside my web api the types of the

Compiling and Running code at runtime in .Net Core 1.0

≯℡__Kan透↙ 提交于 2019-12-17 18:27:18
问题 Is it possible to compile and run C# code at runtime in the new .Net Core (better .Net Standard Platform)? I have seen some examples (.Net Framework), but they used NuGet packages that are not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0) 回答1: Option #1 : Use the full C# compiler to compile an assembly, load it and then execute a method from it. This requires the following packages as dependencies in your project.json: "Microsoft.CodeAnalysis.CSharp": "1.3.0-beta1-20160429-01",

ASP.NET Core HTTPRequestMessage returns strange JSON message

假如想象 提交于 2019-12-17 16:56:48
问题 I am currently working with ASP.NET Core RC2 and I am running into some strange results. So I have an MVC controller with the following function: public HttpResponseMessage Tunnel() { var message = new HttpResponseMessage(HttpStatusCode.OK); message.Content = new StringContent("blablabla", Encoding.UTF8); message.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/plain"); message.Headers.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue {

Build .exe file in .NET Core RC2

拜拜、爱过 提交于 2019-12-17 10:08:32
问题 Every time I build a project using the new .NET Core RC2 templates I am not provided with a runnable . EXE file. If I hit F5 for debugging my console application it runs fine through the C:\Program Files\dotnet\dotnet.exe application. And if I use the dotnet run command in the folder, it runs fine as well. But I see no way to run the application without the .NET Core CLI tools. The contents of my bin\Debug\netcoreapp1.0\ folder looks like this: As you can see there is no . EXE file available.

Authentication in dot net core preview-2.0

戏子无情 提交于 2019-12-12 13:34:18
问题 I tried jwt token authentication in my web api project in .net-core preview-2, but it's not working properly. JwtBearerAppBuilderExtensions.UseJwtBearerAuthentication(IA‌​pplicationBuilder, JwtBearerOptions)' is obsolete: 'See go.microsoft.com/fwlink/?linkid=845470'; When i try same code to dot net core 1.2, it runs properly. What should i do? 回答1: i think you should use: var signingKey = new SymmetricSecurityKey(Encoding.ASCII.GetBytes(Configuration.GetSection("TokenAuthentication:SecretKey"

Bearer Authentication with ASP.NET Core RC2 404 instead of 403

随声附和 提交于 2019-12-12 04:30:28
问题 I am trying to use Bearer Authentication with ASP.NET Core RC2. It is working with user authenticad and has the role, but when the user is not authorized (authenticad but dont have the role) I get a 404 error instead of 403 expected. Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddCors(options => { options.AddPolicy("CorsPolicy", builder => { builder .WithOrigins("*") .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); } ); }); services.AddIdentity

How to manually import the portable profile “portable-net45+win8”?

[亡魂溺海] 提交于 2019-12-12 02:34:45
问题 I am upgrading a .NET solution from .NET Core rc1 to rc2 following the instructions here: http://ef.readthedocs.io/en/latest/miscellaneous/rc1-rc2-upgrade.html In the article it states 'The workaround is to manually import the portable profile “portable-net45+win8”.' Can someone tell me how to manually import this profile please? 回答1: Actually next paragraph contains how to do this. Modify project.json file: { "frameworks": { "netcoreapp1.0": { "imports": ["dnxcore50", "portable-net45+win8"]

Aspnet Core with Adfs 2016 OpenId can't sign out

亡梦爱人 提交于 2019-12-11 13:19:05
问题 I setup an MVC project with Aspnet Core targeting Net461. Authentication is configured to use Adfs from a Windows Server 2016 system. I managed to get sign in working, however, when I click sign out I am given a page cannot be displayed error. Browsing back to the home url shows that the user is still logged in also. Any suggestions? 回答1: You might find this sample useful (even though it is for Azure ADFS, it works for local installs as well): https://github.com/Azure-Samples/active-directory

.net core RC2 using own local Nuget Package: The folder netstandard1.5 contains an invalid version

谁都会走 提交于 2019-12-11 04:25:14
问题 I create a new .net core class library with the following project.json file: { "version": "1.0.0-*", "dependencies": { "NETStandard.Library": "1.5.0-rc2-24027" }, "frameworks": { "netstandard1.5": { "imports": "dnxcore50" } }, "scripts": { "postcompile": [ "dotnet pack --no-build --configuration %compile:Configuration%" ] } } With the "scripts" > "postcompile" I am exporting the nuget package for this library which outputs these files and folder: /netstandard1.5 Solid.Common.Log.1.0.0.nupkg