.net-core-rc2

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

一曲冷凌霜 提交于 2019-11-28 06:41:35
问题 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

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

跟風遠走 提交于 2019-11-28 05:48:59
问题 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"

ASP.NET Core HTTPRequestMessage returns strange JSON message

你。 提交于 2019-11-28 01:49:00
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 { NoCache = true }; return message; } If I call this with postman with an Accept header set to text plain I

ASP.NET Core RC2 SignalR Hub Context outside request thread

删除回忆录丶 提交于 2019-11-27 19:30:25
I am currently trying out the RC2 release of ASP.NET Core and I am running into an issue with SignalR . I need to be able to send messages to the client outside of the request thread. Now in the full .NET framework you can do this like: var context = GlobalHost.ConnectionManager.GetHubContext<MyHub>(); context.Clients.<SendMessage>() But in ASP.NET Core there is no GlobalHost . I found a similar question: How to get SignalR Hub Context in a vNext Project? Where the second answer provides a method to get the hubcontext outside the request thread, but this also does not work in ASP.NET Core . So

Ubuntu - Installing .net core

大城市里の小女人 提交于 2019-11-27 11:29:07
问题 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

Build .exe file in .NET Core RC2

一个人想着一个人 提交于 2019-11-27 10:14:30
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. Just the dll. Am I overlooking something? Or is there something wrong with my project.json file? {

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

纵饮孤独 提交于 2019-11-27 06:37:58
问题 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

How to load assemblies located in a folder in .net core console app

大城市里の小女人 提交于 2019-11-27 00:57:29
I'm making a console app on .Net Core platform and was wondering, how does one load assemblies (.dll files) and instantiate classes using C# dynamic features? It seems so much different than .Net 4.X and it's not really documented... For example let's say I have a class library (.Net Core) and it has only one class: namespace MyClassLib.SampleClasses { public class Sample { public string SayHello(string name) { return $"Hello {name}"; } public DateTime SayDateTime() { return DateTime.Now; } } } So the name of the dll file would be MyClassLib.dll and its located in /dlls/MyClassLib.dll . Now I

ASP.NET Core RC2 SignalR Hub Context outside request thread

时光总嘲笑我的痴心妄想 提交于 2019-11-26 18:12:28
问题 I am currently trying out the RC2 release of ASP.NET Core and I am running into an issue with SignalR . I need to be able to send messages to the client outside of the request thread. Now in the full .NET framework you can do this like: var context = GlobalHost.ConnectionManager.GetHubContext<MyHub>(); context.Clients.<SendMessage>() But in ASP.NET Core there is no GlobalHost . I found a similar question: How to get SignalR Hub Context in a vNext Project? Where the second answer provides a

How to load assemblies located in a folder in .net core console app

大兔子大兔子 提交于 2019-11-26 09:27:21
问题 I\'m making a console app on .Net Core platform and was wondering, how does one load assemblies (.dll files) and instantiate classes using C# dynamic features? It seems so much different than .Net 4.X and it\'s not really documented... For example let\'s say I have a class library (.Net Core) and it has only one class: namespace MyClassLib.SampleClasses { public class Sample { public string SayHello(string name) { return $\"Hello {name}\"; } public DateTime SayDateTime() { return DateTime.Now