project.json

dnxcore50 framework support in ASP.Net 5 Class Library Package project?

孤街醉人 提交于 2019-12-10 18:24:02
问题 I am trying to develop my first ASP.Net web application and in my solution I have two projects. A Web Application and Class Library (Package) and noticed that the Web App has this for it's framework inside the project.json "frameworks": { "dnxcore50": { } } My understanding is that code makes my Web App target Net 5.0 Core but if I look at the project.json for the Class Library I see this: "frameworks": { "net451": { }, "dotnet5.4": { "dependencies": { "Microsoft.CSharp": "4.0.1-beta-23516",

The specified deps.json '$$$' does not exist

吃可爱长大的小学妹 提交于 2019-12-10 04:10:37
问题 I am rather new to the .NET Core, and I got a .NET Core WebAPI project MyWebApp, also, i have .Net Core Class Library project MyLib using EntityFrameworkCore When i try to use Add-Migration, i get the error The specified deps.json [...\MyWebApp\bin\Debug\netcoreapp1.1\MyWebApp.deps.json] does not exist Inspecting the folder, I noticed I have this a file in [...\MyWebApp\bin\Debug\netcoreapp1.1\win10-x64\MyWebApp.deps.json] but i really can't figure what i am supposed to do to resolve this.

How to run XUnit tests in the project.json and dotnet tfm world

耗尽温柔 提交于 2019-12-09 16:53:21
问题 Background: Recently I switched from the "old" world to the new project.json world, because new is always better ;) Currently 2 out of 3 projects can use the "dotnet" target framework moniker, the other one needs the full .NET framework (net46). I also switched my test projects to the new project.json world, but it I can´t run any tests. The build is green, but no tests are found. I read this documentation and included the xunit.runner.dnx, but the problem is that is is not a "dnx" project -

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

大憨熊 提交于 2019-12-09 15:20:26
问题 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.

Complete list of ASP.Net 5 project.json Script Commands? (Visual Studio 2015)

江枫思渺然 提交于 2019-12-09 05:09:12
问题 I have looked at the the ASP.Net 5 teams wiki entry for project.json , to identify which Script Commands are available, and currently the following are listed: { "scripts": { "prebuild": "echo before building", "postbuild": "echo after building", "prepack": "echo before packing", "postpack": "echo after packing", "prerestore": "echo before restoring packages", "postrestore": "echo after restoring packages" } } These are straightforward, and easy to understand; however in Visual Studio, only

Asp.Net 5: How to load assembly version from project.json file?

こ雲淡風輕ζ 提交于 2019-12-08 16:24:31
问题 I've the project.json file with a version specified as { "version": "1.0.0-*" } How can I read it in code? 回答1: Get the AssemblyInformationalVersionAttribute from the assembly 回答2: in your project.json change the "version": "1.1.xxxx" then in your razor view, maybe _Layout footer? @using System.Reflection @{ ViewData["Version"] = typeof(Startup).GetTypeInfo().Assembly.GetCustomAttribute().InformationalVersion; } then ViewData["Version"] 来源: https://stackoverflow.com/questions/32826684/asp-net

Getting Could not load file or assembly 'System.Core, Version=4.0.0.0..' While doing unit testing in asp.net core with moq

时间秒杀一切 提交于 2019-12-08 04:34:21
问题 I am having a very simple unit test. when I run the test I get the exception Could not load file or assembly 'Could not load file or assembly 'System.Core, Version=4.0.0.0..' This error started appearing after I added "Microsoft.NETCore.Portable.Compatibility": "1.0.1" in my Project.json file. But it is required or else I cannot use lambda Expression in unit testing. There is no compile time error in my unit test.I am sure there is nothing wrong with my test it is the project.json file

Enabling StyleCop.Analyzers on ASP.NET Core projects

送分小仙女□ 提交于 2019-12-08 02:26:27
问题 According to the docs I've read online all you need to do is add the following to the dependencies in project.json: "version": "1.0.0-*", "dependencies": { "DependencyA": "1.0.0-*", "DependencyB": "1.0.0-*", "StyleCop.Analyzers": { "version": "1.0.0", "type": "build" } }, "frameworks": { "net46": { } } (where DependencyA and DependencyB are two .NET Core projects from the same solution) and then StyleCop.Analyzers will run with the default rule set upon building the project. It doesn't. I get

C++ project dependency for .NET Core project

时间秒杀一切 提交于 2019-12-07 11:13:07
问题 I have solution with .NET Core project and C++ project. .NET Core project uses compiled C++ library via interop and DllImport. How can I configure my build process properly? I would like to have: Native library is built Native library is copied to output directory to my main application Is it possible to do that with project.json and "dotnet build/publish" command? 回答1: Open the property window of your native C++ project. Find Build Events/Post-Build Event/Command Line. Then input the

Copying files on compile for Asp.net Core 1.0 project

╄→尐↘猪︶ㄣ 提交于 2019-12-07 07:11:35
问题 I'm creating a REST Api with Asp.Net Core 1.0 and I want to copy a file which is not in included in the project to the output path when the project is compiled. I can't figure out how to do it though. I have tried to use "buildOptions: copyToOutput" without any success. I can't really understand the project.json reference found here: https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json Say that I want to copy the file ....\TestFolder\Test.config to the output folder of the