dnx

Copy content files to output directory of DNX Console app via project.json

自闭症网瘾萝莉.ら 提交于 2019-12-04 00:38:35
I've just started working with DNX 1.0.0-rc1-update1 in VS2015. My first app is a 'Console Application (package)' project. Everything works, except NLog logging. I suspect it's because the NLog.config doesn't get copied to the output folder. How can I tell VS to copy this file to the output folder via project.json? I've tried adding a 'resource' variable like this but it doesn't work: project.json ... "resource":"NLog.config", ... EDIT 1: I'm using dnx451 so compatibility is not an issue. EDIT 2: I added the following to project.json "scripts": { "postbuild": [ "%project:Directory%/../scripts

How to stream a video or a file considering request and response range headers?

我怕爱的太早我们不能终老 提交于 2019-12-03 18:32:23
问题 I am now using FileStreamResult and it works to stream a video, but can't seek it. It always starts again from the beginning. I was using ByteRangeStreamContent but it seems that it is not available anymore with dnxcore50 . So how to proceed ? Do i need to manually parse the request range headers and write a custom FileResult that sets the response Content-Range and the rest of the headers and writes the buffer range to the response body or is there something already implemented and i'm

ASP.NET 5 RC1: System.IO.InvalidDataException: Unexpected end of request content

谁都会走 提交于 2019-12-03 14:35:53
I am running an ASP.NET 5 project in an Azure Web App. When calling on an API endpoint with a file (form-data) of about 1.5mb or larger, the following exception is thrown. Here is where the exception is thrown from . Does anyone know how this can be fixed? Is there a possible workaround? System.IO.InvalidDataException: Unexpected end of request content at Microsoft.AspNet.Server.Kestrel.Http.MessageBody.ForContentLength.d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at

DNX Web command throwing 'unable to resolve project' error after publishing from VS2015

十年热恋 提交于 2019-12-03 11:33:21
This is about an obsolete pre-release version of .net core. I have created a basic project in pre-release ASP.Net 5 (later on was renamed to asp.net core) using a beta/preview of visual studio 2015, I have published the project to a file system and am trying to run it from there using the command dnx . web the error that results is 'unable to resolve project'. I have checked that dnvm is using the default framework. My published directory has web, web.cmd, wwwroot, and approot folders. Is there anything else I should be checking? I am using: asp.net core 1.0.0-beta4 clr For ASP.NET Core

dotnet restore keeps using local project instead of nuget package

狂风中的少年 提交于 2019-12-03 09:56:17
I have a .NET-core project in Visual Studio 2015. In it, I used a Nuget package, but after finding a bug in the package, I checked out its source code and included the library project into my solution to debug the issue. After successfully resolving the problem I sent the fix upstream, it was accepted and a new Nuget package version was released. So I went, removed the library project from my solution and intended to update the package to the fixed version to continue working on my project. Visual Studio Nuget Package Manager found the new version and everything seemed fine for a while.

UWP application and .NET Core RC2: cannot reference netstandard1.4 packages

岁酱吖の 提交于 2019-12-03 07:28:23
问题 I have a scenario where I run a UWP client application, a UWP IOT application and a .NET Core application using a shared code base. In .NET Core RC1 I built a Class Library (Package) and used "dotnet5.4" as the base framework for that library. Using "generate build output" I could reference the created nuget packages from the .NET Core application (console) and using a workaround (copy the packages from %local%.dnx -> %local%.nuget) the UWP applications were able to reference and use the

Where to find 'dnu' command in Windows

本秂侑毒 提交于 2019-12-03 04:02:21
问题 I have recently installed Visual Studio 2015 RC. I'm trying to figure out the new .NET Core thing... Now I want to package my application and launch it. I wanted to play with DNX Utility but can not figure out how to run it. My command prompt still insists that there is no dnu command by saying: 'dnu' is not recognized . Searched all the entire file system but nothing found. So I don't think it is a path problem. Do I have to install it manually? Or is it a corrupted installation problem?

MVC 6 install as a Windows Service (ASP.NET Core 1.0.0)

ⅰ亾dé卋堺 提交于 2019-12-03 01:47:06
UPDATE - 26th July 2016 I have added the solution to this in ASP.NET Core 1.0.0 in the answers below. I have created a simple MVC 6 app and have included the Microsoft.AspNet.WebListener library so I can host outside of IIS. From project.json: "dependencies": { "Microsoft.AspNet.Server.WebListener": "1.0.0-beta4", "Microsoft.AspNet.Mvc": "6.0.0-beta4" }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000" } When I publish this I can run the web.cmd file and get the site running in a console window. Great! But in OWIN

How to get the “dnu” command working on OS X?

℡╲_俬逩灬. 提交于 2019-12-03 01:10:37
问题 Just downloaded and installed Visual Studio Code on OS X 10.10.3. I've managed to partially follow the installation instructions for ASP.NET 5. What I fail with is when the instruction tells me to call dnu restore When doing this in my terminal, it says: -bash: dnu: command not found I've found a somewhat similar question here on SO which unfortunately did not help me. My question: How can I make the "dnu" command work on OS X? Update: Someone marked my questions as the duplicate of the SO

Getting interface implementations in referenced assemblies with Roslyn

孤街醉人 提交于 2019-12-02 23:06:33
I'd like to bypass some classical assembly scanning techniques in a framework I am developing. So, say I've defined the following contract: public interface IModule { } This exists in say Contracts.dll . Now, if I want to discover all implementations of this interface, we would probably do something similar to the following: public IEnumerable<IModule> DiscoverModules() { var contractType = typeof(IModule); var assemblies = AppDomain.Current.GetAssemblies() // Bad but will do var types = assemblies .SelectMany(a => a.GetExportedTypes) .Where(t => contractType.IsAssignableFrom(t)) .ToList();