Questions tagged [project.json]

project.json is the project definition file used by .NET Core in version 1.0 and earlier.

project.json will be deprecated in Visual Studio "15" and beyond. See: Changes to project.json

Additional Reading

183 questions
80
votes
2 answers

What is project.lock.json?

I followed the instruction to create new .NET Core project and ran this from cmd: dotnet new dotnet restore The second statement creates project.lock.json that contains a lot of garbage (not really garbage but tons of dependencies, configurations…
Andrei
  • 42,814
  • 35
  • 154
  • 218
39
votes
4 answers

How to use System.Windows.Forms in .NET Core class library

I've created .NET Core class library and try to build it against net40 framework. I want to use Clipboard class from System.Windows.Forms assembly. How can I do this? My project.json file: { "version": "1.0.0-*", "dependencies": { …
Alexander Buts
  • 561
  • 1
  • 4
  • 7
37
votes
1 answer

Add project.json package references to a VSIX

When trying to add references to a VSIX, it normally pulls it from the references in the .csproj. However, if the references are not in the .csproj, because they now are in a project.json file, then they don't get pulled to the vsix. The solution…
Iceman
  • 463
  • 5
  • 14
28
votes
2 answers

What does compilationOptions.emitEntryPoint mean?

Just installed the rc1 tools and created a new web project to see what has changed in the template. I noticed that project.json now contains: "compilationOptions": { "emitEntryPoint": true } But it's unclear what this does. Does anyone have an…
SaphuA
  • 3,092
  • 3
  • 39
  • 58
23
votes
3 answers

project.json Not Found in Visual Studio 2017 RC Solution Explorer

I did not find project.json in visual studio 2017 RC. Has this been removed in this version or am i missing something ? How do they store list of dependencies now if it is removed ?
aspxsushil
  • 514
  • 1
  • 5
  • 16
22
votes
9 answers

ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json

I want to simplify my configuration in my ASP.NET Core Web Application (.NET Framework) application using VS 2017. I already know that my website will be running under Windows/IIS in x64 environment and .NET 4.6.2. There is no chance in the foreseen…
Adam
  • 3,872
  • 6
  • 36
  • 66
22
votes
2 answers

How to set the default namespace in projects using project.json (.xproj)

In a standard .csproj you could go into properties and set the default namespace. How can this be achieved in a .xproj project using project.json?
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
21
votes
2 answers

How can I make a .NET Core class library and reference it from a .NET 4.6 project?

I want to: Make a class library that defines some interfaces and simple generic helper classes. It'll rely on generic collections and IQueryable but no third party dependencies (well, JetBrains.Annotations). Be able to reference that class…
Tim Long
  • 13,508
  • 19
  • 79
  • 147
20
votes
1 answer

Is project.json deprecated?

Is project.json going away and web.config coming back in ASP.NET Core 1.0? In the roadmap document, the update in '16 Q4 or '17 Q1, they mention "replacing .xproj/project.json with .csproj/MSBuild". Does that mark the end of project.json?
Sam
  • 26,817
  • 58
  • 206
  • 383
17
votes
1 answer

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

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…
dmcquiggin
  • 3,230
  • 24
  • 37
16
votes
2 answers

Unit testing a .NET Standard 1.6 library

I am having trouble finding up to date documentation on how to unit test a .NET Standard 1.6 class library (which can be referenced from a .NET Core project). Here is what my project.json looks like for my library: { "supports": {}, …
blgrnboy
  • 4,877
  • 10
  • 43
  • 94
16
votes
1 answer

project.json Equivalent of InternalsVisibleTo

.Net Core's project.json allows configuration of various assembly properties (e.g. title, version, copyright) that a traditional .Net application would define using attributes typically placed in AssemblyInfo.cs (e.g. AssemblyTitle,…
Ben Gribaudo
  • 5,057
  • 1
  • 40
  • 75
16
votes
3 answers

What are buildOptions and preserveCompilationContext used for?

I am playing with just released ASP.NET Core. I have created new project and I am looking at project.json. I'd like to know what is this part of configuration for: "buildOptions": { "emitEntryPoint": true, "preserveCompilationContext": true }
Andrei
  • 42,814
  • 35
  • 154
  • 218
16
votes
2 answers

Why does my project.json / xproj project not open in Visual Studio 15 (preview)?

I have an existing solution involving multiple project.json (and corresponding xproj) projects that I have been working on for some time. It works fine in Visual Studio 2015, but it fails to load in VS 15 (preview), just showing a failed load icon…
Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
15
votes
2 answers

How to run scripts based on solution configuration in ASP.NET Core

I have the following script in my project.json file which I am using to build my class library project into a NuGet package. I don't want to build any Debug NuGet packages. How can I limit this script to only run when the solution configuration is…
Muhammad Rehan Saeed
  • 35,627
  • 39
  • 202
  • 311
1
2 3
12 13