.net-core-rc2

ASP.NET Core RC2 as linux deamon

老子叫甜甜 提交于 2019-12-03 12:26:44
I need information about hosting of net core console or asp.net application as linux deamon. Hosting application as Windows Service is already supported by Microsoft.Hosting.WindowsService, but I need something similar for linux deamons. I'm running on RHEL, and therefore have chosen to write my own systemd unit files. Here is an example of one I use in conjuction with PostgreSQL (hence the Environment variable). I've stripped out sensitive information for obvious reasons. [Unit] Description=My Sample Application Documentation= Wants=network.target After=network.target [Service] User

dotnet run OR dotnet watch with development environment from command line?

那年仲夏 提交于 2019-12-03 01:09:43
问题 I am using dotnet watch command to run asp.net core project. However, by default, it is picking up the Production as an environment. I have tried both options using: 1) > dotnet watch ASPNETCORE_ENVIRONMENT=Development 2) > dotnet run ASPNETCORE_ENVIRONMENT=Development But it still picks up production as an environment. Note: In visual studio environment variable is set in project properties as Development by default and running from visual studio picks that variable. Question is: How to run

.NET CLI how to run app after publish on Linux

你离开我真会死。 提交于 2019-12-02 23:44:33
I spent ~4 hours investigation and still can't find out how to run published application ( dotnet publish ) Now I can download sources to my remote machine, then call dotnet build and dotnet run - then my app runs as intended. But I want to publish just DLL's (or *.so ?) to my VPS without source files. What official docs says? To define command in project.json "commands": { "web": "Microsoft.AspNet.Server.Kestrel --server.urls http://unix:/var/aspnet/HelloMVC/kestrel.sock", } But it is obsolette, isn't it? What about default samples? In default VS2015 sample solution they use publish-iis, Full

The .NET Core SDK is not installed or cannot be found under the path

一笑奈何 提交于 2019-12-02 22:03:44
When compiling .Net Core RC2 project under VS 2015 I am receiving following error GETSDKTOOLINGINFO : error : The .NET Core SDK is not installed or cannot be found under the path C:\Program Files\dotnet\bin. These components are required to build and run this project. Files do exist under that directory. Also when I input dotnet into command line I do see it's prining proper version number and stuff.(.NET Command Line Tools ( 1.0.0-beta-001598 ) Any idea how to resolve the issue? user6352951 Remove all older versions of core Unistall Microsoft .NET CLI for Windows from control panel if it

dotnet run OR dotnet watch with development environment from command line?

本小妞迷上赌 提交于 2019-12-02 14:27:06
I am using dotnet watch command to run asp.net core project. However, by default, it is picking up the Production as an environment. I have tried both options using: 1) > dotnet watch ASPNETCORE_ENVIRONMENT=Development 2) > dotnet run ASPNETCORE_ENVIRONMENT=Development But it still picks up production as an environment. Note: In visual studio environment variable is set in project properties as Development by default and running from visual studio picks that variable. Question is: How to run dotnet core project in development from command line using either?: 1) dotnet run 2) dotnet watch

.NET Core 1.0 - How to run “All tests in Solution” with xUnit command line

走远了吗. 提交于 2019-12-01 13:58:54
问题 The Getting started with xUnit.net (.NET Core / ASP.NET Core) page describes how to run tests with dotnet test command line. It states that it requires a specific project.json , where we add xunit dependencies and test runner: "testRunner": "xunit", "dependencies": { "xunit": "2.1.0", "dotnet-test-xunit": "1.0.0-rc2-build10015" } If I try calling it from the parent directory: C:\git\Project\test [master ≡]> dotnet test dotnet-test Error: 0 : System.InvalidOperationException: C:\git\Project

Why the TestServer (AspNetCore) gives 404 error on static files?

元气小坏坏 提交于 2019-12-01 12:08:54
I have a sample server var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .Build(); host.Run(); with configuration in Startup class: public void Configure(IApplicationBuilder app) { app.Run(async (context) => { await context.Response.WriteAsync("Hello World!"); }); } and I am using xunit test (learning): public TestFixture() { var builder = new WebHostBuilder().UseStartup<TStartup>(); _server = new TestServer(builder); Client = _server.CreateClient(); Client.BaseAddress = new Uri(address); } and later var

Why the TestServer (AspNetCore) gives 404 error on static files?

二次信任 提交于 2019-12-01 11:36:37
问题 I have a sample server var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .Build(); host.Run(); with configuration in Startup class: public void Configure(IApplicationBuilder app) { app.Run(async (context) => { await context.Response.WriteAsync("Hello World!"); }); } and I am using xunit test (learning): public TestFixture() { var builder = new WebHostBuilder().UseStartup<TStartup>(); _server = new

How to fix intellisense with referenced netstandard1.5 library projects in Visual Studio 2015?

感情迁移 提交于 2019-12-01 08:47:07
I have four library projects that are all targeting the netstandard1.5 framework. Some of them depend on the other and the intellisense is working fine under those four projects. I am trying to use these libraries inside my ASP.NET netcoreapp1.0 project. But when I target the netcoreapp1.0 framework the types are not found (outlined red in visual studio). The project hower compiles and runs successfully. As soon as I switch to the netstandard1.5 framework inside my web api the types of the libraries are recognized and I get intellisense. Any ideas on how to fix this or what I am doing wrong?

One or more packages are incompatible with .NETStandard,Version=v1.5

牧云@^-^@ 提交于 2019-12-01 00:24:03
问题 I created a new .NET Core Class Library and added a Nuget package from an internal company Nuget server. I began getting the following error: Package XXXX is not compatible with netstandard1.5 (.NETStandard,Version=v1.5). Package XXXX 1.0 supports: net45 (.NETFramework,Version=v4.5) One or more packages are incompatible with .NETStandard,Version=v1.5. I updated the project.json file to look like this but the same error persists. { "version": "1.0.0-*", "dependencies": { "XXXXX": "1.0.0",