.net-core-rc2

How to Create NuGet Packages From .Net Core RC2 Class Libraries

☆樱花仙子☆ 提交于 2019-11-30 08:42:58
I have a solution in Visual Studio with 12 projects. I would like to create a nuget package from Visual Studio, but it appears the "Produce outputs on build" that was there from RC1 is missing. I can go ahead and create a script that goes to each folder and call "dotnet pack", but is there an option in Visual Studio that I am missing to do this? Add this to your project.json file: "scripts": { "postcompile": [ "dotnet pack --no-build --configuration %compile:Configuration%" ] } This will run the dotnet pack command which will pack your build output produced after compilation into a NuGet

Compiling and Running code at runtime in .Net Core 1.0

强颜欢笑 提交于 2019-11-30 03:52:46
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) 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", "System.Runtime.Loader": "4.0.0-rc2-24027", Then you can use code like this: var compilation =

RequireHttpsAttribute with .NETCore RC2 causes HTTP302 redirect loop on Azure

随声附和 提交于 2019-11-29 16:56:37
I've been trying to get a .NETCore RC2 web app working on Azure with the RequireHttpsAttribute set but I'm having issues. To remove the possibility of this being a problem that I've introduced with my code, I cut things back to the bare minimum and recreated it using the "out of box" VS2015 .NETCore RC2 template. If I deploy the standard VS2015 .NETCore RC2 web app the site runs fine. If I then add [RequireHttps] to the controllers it works fine locally, but on Azure it causes an HTTP302 redirect loop. This seems to be something which has changed since RC1 since the RequireHttpsAttribute works

Referencing old (full .NET Framework) Class Library when targeting .NET Core

隐身守侯 提交于 2019-11-29 12:58:53
I'm developing a web application on .Net Core, but as .Net Core is still on development some libraries used are not built on Core yet. I know I can target .Net 4.6 in my application to use old libraries but I'm not sure about what actually change in the use of new .Net Core functionality inside my app. I know this way I'm loosing multi platform capabilities but I actually don't need it at the moment insead I need going on using API and MVC unified pipeline, the integrated dependency Ingnection container and other .Net Core new functionality Will this be aniway possible by targeting old

How to Create NuGet Packages From .Net Core RC2 Class Libraries

偶尔善良 提交于 2019-11-29 12:13:48
问题 I have a solution in Visual Studio with 12 projects. I would like to create a nuget package from Visual Studio, but it appears the "Produce outputs on build" that was there from RC1 is missing. I can go ahead and create a script that goes to each folder and call "dotnet pack", but is there an option in Visual Studio that I am missing to do this? 回答1: Add this to your project.json file: "scripts": { "postcompile": [ "dotnet pack --no-build --configuration %compile:Configuration%" ] } This will

Visual Studio 2015 ASP.NET Core RC2: loss of Custom Item Templates

时光怂恿深爱的人放手 提交于 2019-11-29 12:08:23
I use Visual Studio 2015 update 2 Community Edition. With Visual Studio DotNetCore RC1 tools I had my custom Item Template under DNX section. I can't provide proving screenshot because I already moved to DotNetCore RC2 Tools Preview 1. With the last set of tools I lost my Item Template. I tried to change ProjectType and ProjectSubType from DNX to CSharp/Web, tried to put component in different places with no success. The last .vstemplate file has the following content <?xml version="1.0" encoding="utf-8"?> <VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate

Can't find Abort method in Thread

删除回忆录丶 提交于 2019-11-29 03:54:57
I'm porting a project to .NET Core and have some logic with the method. Do you know .NET Core supports Abort() method in Thread class? Thread.Abort has been removed in .NET Core. Move Thread.Abort under FEATURE_LEGACYSURFACE https://github.com/dotnet/coreclr/pull/2342 Never call Thread.Abort https://github.com/aspnet/KestrelHttpServer/pull/726 for tests purpose the custom Abort Ext method is used As far as I have understood so far it is now recommended to use CancellationToken. Please read more about how to use this here: https://msdn.microsoft.com/en-us/library/dd997364(v=vs.110).aspx 来源:

Ubuntu - Installing .net core

帅比萌擦擦* 提交于 2019-11-28 18:33:40
I want to try out the new .net core. I am following instructs at https://www.microsoft.com/net/core , but it is not working. Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: dotnet-dev-1.0.0-preview1-002702 : Depends:

Display project version in ASP.NET MVC Core application (RC2)

久未见 提交于 2019-11-28 11:57:09
How do I display application version from the project.json? I am using gulp-bump to autoincrement version, but I can't show the recent version. Here is what I'm trying: @(Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion) This does not work, it displays " 1.0.0 " instead of real value from project.json I also tried this but it looks like it is no longer works in RC2: @inject Microsoft.Extensions.PlatformAbstractions.IApplicationEnvironment appEnv My version number is @(appEnv.ApplicationVersion) As per this announcement , IApplicationEnvironment

RequireHttpsAttribute with .NETCore RC2 causes HTTP302 redirect loop on Azure

亡梦爱人 提交于 2019-11-28 10:59:36
问题 I've been trying to get a .NETCore RC2 web app working on Azure with the RequireHttpsAttribute set but I'm having issues. To remove the possibility of this being a problem that I've introduced with my code, I cut things back to the bare minimum and recreated it using the "out of box" VS2015 .NETCore RC2 template. If I deploy the standard VS2015 .NETCore RC2 web app the site runs fine. If I then add [RequireHttps] to the controllers it works fine locally, but on Azure it causes an HTTP302