project.json

Frameworks and imports sections in project.json: what are they?

血红的双手。 提交于 2019-12-06 22:22:58
问题 What exactly are the frameworks and imports sections of the project.json file of a ASP.NET Core 1.0 project and what do they do? I've been trying to find "official" documentation to understand it better. Here's a boilerplate example from a recent Yeoman-scaffolded ASP.NET project I started up: "frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "dnxcore50", "portable-net45+win8" ] } }, 回答1: frameworks is the list of target frameworks that you application supports. imports is a way to

Enabling StyleCop.Analyzers on ASP.NET Core projects

非 Y 不嫁゛ 提交于 2019-12-06 06:25:29
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 no warnings or anything and I'm pretty sure the code at the moment violates a lot of rules. Did anyone

C++ project dependency for .NET Core project

隐身守侯 提交于 2019-12-05 14:25:21
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? Open the property window of your native C++ project. Find Build Events/Post-Build Event/Command Line. Then input the following commands to copy the built dll and pdb files to the output directory of your main application. xcopy /Y

'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

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

こ雲淡風輕ζ 提交于 2019-12-05 04:32:56
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. myWebApi project.json: { "dependencies": { "ShopManager": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles":

Why can't I use embedded resources (resx) when targeting .netstandard 1.3?

删除回忆录丶 提交于 2019-12-05 04:16:37
(Question subtitle: Are resources not supported in .netstandard 1.3 or is my project file just messed up?) I just created an example portable class library in Visual Studio 2015 Update 3 and added a sample resource file. Initially, the file project.json looks like this: { "supports": { "net46.app": {}, "uwp.10.0.app": {}, "dnxcore50.app": {} }, "dependencies": { "Microsoft.NETCore": "5.0.0", "Microsoft.NETCore.Portable.Compatibility": "1.0.0" }, "frameworks": { "dotnet": { "imports": "portable-net452+win81" } } } Fine: No compile errors! After that, I used the project properties to target

Reference a class library from UWP and ASP.NET 5

╄→尐↘猪︶ㄣ 提交于 2019-12-05 03:34:17
I am trying to create a class library that'll contain common objects (mainly DTOs) of a WebAPI (using ASP.NET 5) and a consuming UWP App. However, I have not yet figured out how to create the class library such that it can be referenced from both other projects. What I have tried so far: First, I tried a Class Library (Package) , which can be found under Web . This type of library can be referenced from the ASP.NET project without problems, but when trying to reference it from the UWP project, I get the following message: A reference to 'ClassLibrary1' could not be added. Next, I tried a Class

Frameworks and imports sections in project.json: what are they?

二次信任 提交于 2019-12-05 01:26:01
What exactly are the frameworks and imports sections of the project.json file of a ASP.NET Core 1.0 project and what do they do? I've been trying to find "official" documentation to understand it better. Here's a boilerplate example from a recent Yeoman-scaffolded ASP.NET project I started up: "frameworks": { "netcoreapp1.0": { "imports": [ "dotnet5.6", "dnxcore50", "portable-net45+win8" ] } }, frameworks is the list of target frameworks that you application supports. imports is a way to use packages that were not designed for that framework. Basically you tell it "Use those targets even

How to let a Visual Studio 2015 xproject (project.json) reference the highest framework of a depending project

我与影子孤独终老i 提交于 2019-12-04 03:05:25
问题 I'm creating a reusable library that targets several platforms (.NET 4.0, .NET 4.5, .NETStandard 1.0 and .NETStandard 1.3). The .NET 4.5 version of this project contains some features that are not available under the .NET 4.0 version. The unit test project that references this library project has one single target platform, namely NET 4.5.1. This test project obviously contains some code that tests the .NET 4.5 specific features of the core library. Unfortunately however, the test project

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