dnx

Alternative solution to HostingEnvironment.QueueBackgroundWorkItem in .NET Core

徘徊边缘 提交于 2019-11-28 19:35:11
问题 We are working with .NET Core Web Api, and looking for a lightweight solution to log requests with variable intensity into database, but don't want client's to wait for the saving process. Unfortunately there's no HostingEnvironment.QueueBackgroundWorkItem(..) implemented in dnx , and Task.Run(..) is not safe. Is there any elegant solution? 回答1: QueueBackgroundWorkItem is gone, but we've got IApplicationLifetime instead of IRegisteredObject , which is being used by the former one. And it

Can't compile Environment.Exit in .NET Core

China☆狼群 提交于 2019-11-28 12:14:40
Related: System.Environment in .NET Core I'm trying to compile a program which uses Environment.Exit in .NET Core. I've used yo aspnet to create the default console application, installed System.Runtime.Extensions and then added a call to Environment.Exit(1) (full sample on github ). When running dnu build I get this error: C:\git\environmentexit\ConsoleApplication\Program.cs(13,25): DNXCore,Version=v5.0 error CS0117: 'Environment' does not contain a definition for 'Exit' As far as I can tell, this corefx pull request should mean that Environment.Exit is exposed, so I can't figure out what

HttpClient in ASP.NET 5.0 not found?

我的未来我决定 提交于 2019-11-28 11:54:29
Using VS2015 and asp.net 5, when I try to compile my site using an instance of System.Net.HttpClient, it tells me: The type or namespace name 'HttpClient' could not be found (are you missing a using directive or an assembly reference?) Hovering over the offending code, I see: "WebApplication1.ASP.NET 5.0 - Available" "WebApplication1.ASP.NET Core 5.0 - Not Available" I have 2 frameworks listed in my project.json file: "frameworks": { "aspnet50": { }, "aspnetcore50": { } }, I'm assuming that one of these is responsible by not having the assembly, but I don't really know how to fix it or how

How to reference Windows.winmd from a .NET Core library?

≡放荡痞女 提交于 2019-11-28 06:36:21
问题 I'm looking to use Windows Runtime types, like Frame or Button , from a .NET Core library. It seemed to be working fine when I was using a traditional PCL, targeted for Windows/Windows Phone 8.1. For some reason, however, it's not compiling after I switched my project to DNX. Here's my project.json : { "frameworks": { // Profile32 == Windows + Windows Phone 8.1 ".NETPortable,Version=v4.6,Profile=Profile32": { } } } And here is my sample code: using System.Linq; using Windows.UI.Xaml.Controls;

How can I diagnose missing dependencies (or other loader failures) in dnx?

落花浮王杯 提交于 2019-11-28 02:47:22
I'm trying to run a modified version of the HelloWeb sample for ASP.NET vNext on DNX using Kestrel. I understand that this is very much on the bleeding edge, but I would hope that the ASP.NET team would at least keep the simplest possible web app working :) Environment: Linux (Ubuntu, pretty much) Mono 3.12.1 DNX 1.0.0-beta4-11257 (I have 11249 available too) "Web app" code, in Startup.cs : using Microsoft.AspNet.Builder; public class Startup { public void Configure(IApplicationBuilder app) { app.UseWelcomePage(); } } Project config, in project.json : { "dependencies": { "Kestrel": "1.0.0

Self-Registering Libraries with Autofac 4 and vNext

断了今生、忘了曾经 提交于 2019-11-28 01:31:40
问题 i'd like to create a Plugin Enviroment for my ASP.Net 5.0 / MVC 6 Application. I'm using Autofac as IOC Container and i like to load the Plugins (Class Libraries) from the build in DNX LibraryManager. The goal of using the Library Manager is, that i don't have to care about NuGet Packages and Frameworks. The Problem i have is the LifeCycle, i have to build the IOC Container before the instance of the LibraryManager is available. Because the Autofac Container provides his own IServiceProvider

Is it possible to run ASP.NET 5 site directly on Kestrel in Azure WebApps?

℡╲_俬逩灬. 提交于 2019-11-27 21:23:20
问题 I have checked that in the web response the server is IIS when I deploy ASP.NET5 to azure web app, so I guess the IIS platform handler is used to redirect it to Kestrel. So I am wondering if it is possible to run directly on Kestrel, and what benefits/drawbacks will that have (probably regardless if it's in Azure or not). I suppose it will be a bit faster since IIS will be excluded from the pipline, but it should not be too much overhead I suppose... 回答1: On Azure Web App, you cannot bypass

Is .NET Execution Environment (DNX) similar to mono?

与世无争的帅哥 提交于 2019-11-27 17:51:17
Here is the description of DNX: The .NET Execution Environment (DNX) is a software development kit (SDK) and runtime environment that has everything you need to build and run .NET applications for Windows, Mac and Linux. It provide a host process, CLR hosting logic and managed entry point discovery. DNX was built for running cross-platform ASP.NET Web applications, but it can run other types of .NET applications, too, such as cross-platform console apps. Is DNX alternative of mono? If not, then what will be the difference? Is DNX alternative of mono? If not, then what will be the difference?

ASP.NET 5 An error occurred while starting the application

我是研究僧i 提交于 2019-11-27 17:22:17
问题 After publishing an ASP.NET Web App, I'm trying to host the website on my local server. However, when I start it up, it gives me this error in my browser: Oops. 500 Internal Server Error An error occurred while starting the application. How can I debug what this error is? The website works (both Debug and Release configurations) when starting using IISExpress and "web" in Visual Studio. I am using the Development environment, and I have already specified app.UseDeveloperExceptionPage(); . I

Building a .NET Core app via command line, so that it works on a machine without .NET Core installed

折月煮酒 提交于 2019-11-27 17:11:50
问题 My end goal is to create a cross-platform (non-web) console application, so I'm exploring .NET Core right now. In my previous .NET projects, I did all the development inside Visual Studio, but I also created a batch/MSBuild file so I could build the whole project (including setups, NuGet packages, zip files with binaries etc.) with one single click. Here's an example from a previous project. In the end, I want to do something similar with my .NET Core test project. But right now I'm failing