dnx

Is there any difference/reason to create dnx50 build target in addition to dnx451?

◇◆丶佛笑我妖孽 提交于 2019-12-05 15:58:40
问题 Usually we see the following targets in project.json : "frameworks": { "net45": {}, "dnx451": {}, "dnxcore50": { } } dnxcore50 will be the only portable version of the project code and dnx451 actually targets .Net 4.5.1 mscorlib etc... Now, if I add another target called dnx50 , this will create a valid output and works just fine. The difference between dnx451 and dnx50 is, that it references different .Net assembly dlls For example mscorlib.dll : dnx451 references C:\Program Files (x86)

'prebuild' scripts in project.json doesn't run

戏子无情 提交于 2019-12-05 13:11:47
问题 I have a .NET 5 web application using the DNX framework, and I want to run 'npm install', 'bower install' and others, whenever I build the project. Right now I'm able to do so on publish, using 'prepublish', but it doesn't seem to work with 'prebuild', although I saw it is possible here What I have now: "scripts": { "prepublish": [ "npm install", "bower install", "tsd install", "gulp min" ] } 回答1: As of RC1, you have to "produce outputs" to pipe the build through dnu : 回答2: I know this

Running first ASP.NET 5 application using VSCode, DNX and kestrel results in IOException

≡放荡痞女 提交于 2019-12-05 12:04:30
问题 Following the steps described in the Visual Studio Code documentation, running the final command dnx . kestrel via the Command Palette of VSCode on Mac OS X results in an IOException when visiting http://localhost:5001: kqueue() FileSystemWatcher has reached the maximum nunmber of files to watch. See the attached screenshot for the complete stacktrace. What could be wrong? 回答1: It's a known mono bug. In order to fix it set the MONO_MANAGED_WATCHER environment variable: export MONO_MANAGED

Rijndael in class library (package) not available for .NET Core

。_饼干妹妹 提交于 2019-12-05 11:40:37
Please help me. Where to find the Rijndael Security Cryptography in .NET Core? What dependency I must to include in my class library (Package) project? The Rijndael implementation is not (yet) ported to .NET Core. You could use AES (which is a subset of Rijndael) using the System.Security.Cryptography.Algorithms package which targets netstandard1.3 : var aes = System.Security.Cryptography.Aes.Create(); Note: you should only add this package dependency to the netstandard1.3 TFM, as it exists in the core library of the full framework already: "netstandard1.3": { "dependencies": { "System

View code changes without restarting the server

为君一笑 提交于 2019-12-05 10:21:35
We're using Visual Studio Code and DNX as follows. Command Line to Start Web Server dnx . web project.json > commands "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001" Note that we added carriage returns for readability. When we change a *.cshtml and refresh the browser, the changes show up in the browser. This is good. When we change a *.cs and refresh the browser, the changes do not show up in the browser. We expected that they would. To see the changes, we need to stop the web server (with Ctrl + C in the command line) and

MVC 6 Web Api: Resolving the location header on a 201 (Created)

我们两清 提交于 2019-12-05 02:46:13
In Web Api 2.2, we could return the location header URL by returning from controller as follows: return Created(new Uri(Url.Link("GetClient", new { id = clientId })), clientReponseModel); Url.Link(..) would resolve the resource URL accordingly based on the controller name GetClient : In ASP.NET 5 MVC 6's Web Api, Url doesn't exist within the framework but the CreatedResult constructor does have the location parameter: return new CreatedResult("http://www.myapi.com/api/clients/" + clientId, journeyModel); How can I resolve this URL this without having to manually supply it, like we did in Web

AsyncLocal Value updated to null on ThreadContextChanged

你。 提交于 2019-12-05 01:17:30
I'm trying to understand how AsyncLocal should work in .Net 4.6. I'm putting some data into AsyncLocal...but when the ThreadContext changes it is getting set to null. The whole reason I'm using AsyncLocal is to try to preserve/cache this value across threads as I await async operations. Any idea why this would be specifically called and set to a null as the context changes? Documentation on AsyncLocal is very sparse...perhaps I've got it all wrong. public class RequestContextProvider : IRequestContextProvider { private static readonly AsyncLocal<IRequestContext> _requestContext = new

How to consistently get application base path for ASP.NET 5 DNX project on both production and development environment?

丶灬走出姿态 提交于 2019-12-05 00:43:37
I have deployed a ASP.NET MVC 6 website to Azure from Git. Details of the deployment can be found in this blog post but basically I use DNU to publish it and then kudu to push it to an Azure website. Using IHostingEnvironment I get the ApplicationBasePath. The problem is that the paths I get back are very different on localhost and on Azure. Azure: "D:\home\site\approot\src\src" Localhost: "C:\Users\deebo\Source\mysite\site\src" I want to use the base path to get the full path to a folder containing some images: wwwroot/img/gallery/ I got around this with the following code: var rootPath =

VS 2015: Profiling tools disabled in Performance Wizard

百般思念 提交于 2019-12-05 00:10:38
I want to sample the performance of our application, but the various tools (such as CPU Usage and Application Timeline) are not available when trying to start a new profiling session with the Performance Wizard: I am using Visual Studio 2015 Professional. The application is using ASP.NET 5 RC1 and is running from Kestrel (not IIS). Why could this be happening? As a workaround, you can use the "Diagnostic Tools" panel when debugging, it has a CPU profiler built in. 来源: https://stackoverflow.com/questions/36908346/vs-2015-profiling-tools-disabled-in-performance-wizard

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

感情迁移 提交于 2019-12-04 17:58:08
问题 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