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
3
votes
0 answers

Using ilrepack in a .netstandard project to merge all assemblies from a nuget package

I'm building a public nuget package from a .NetStandard project. This project uses a private nuget package (from a private nuget server) targeting .netStandard too. Before switching to .net standard, nuget references were in package.config, and…
Softlion
  • 12,281
  • 11
  • 58
  • 88
3
votes
1 answer

Read project.json version number at runtime

How can one read the project.json version number at runtime? I.e. the "1.0.0-1234" in the config below: { "title": "MyProject.Api", "webroot": "wwwroot", "version": "1.0.0-1234", "dependencies": { ... }, ... }
Dave New
  • 38,496
  • 59
  • 215
  • 394
3
votes
1 answer

.NET Core RC2: use local fork of a package

I have a project which in turn references a fork of an official nuget'd library (forecast.io). I've arranged my global.json to find my copy of the lib, yet a dotnet restore still seems to reach out to the official version rather than my fork. I…
Malachi
  • 2,260
  • 3
  • 27
  • 40
3
votes
2 answers

Project.json Settings Based on Solution Configuration

I have enabled the following xmlDoc setting in my projec.json file: "buildOptions": { "xmlDoc": true } I only want to comment some of my MVC Controllers to support Swashbuckle and I get lots of warnings complaining that the rest of my code is…
3
votes
1 answer

Is there an alternative to contentFiles with projects that use packages.config?

I have a nuget package with content that I want to be copied to the build output when users install my package. There is support for this: NuGet ContentFiles Demystified in NuGet v3.3. However, it only works in projects that use project.json. The…
3
votes
1 answer

Automating Nuget Package Push With .NetCore RC2

I am currently working on a .NET Core library that I am going to use as a NuGet package in another project. I have been able to successfully package the project using the "dotnet pack" command in the project directory, and upload that package to…
3
votes
2 answers

How do I declare a development dependency in project.json?

In my project.json, I need to refer to a library that I'm using during development, but don't want included in the project output. This is common for things like static analyzers and other tools. Before project.json, this was handled by a metadata…
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
3
votes
0 answers

ASP.Net 5 RC1 unresolved dependency: NU1001 The dependency ... >= 1.0.0-* could not be resolved

I hoping someone can help shed some light on how to get around this issue. I've noticed this issue while attempting to add a classic .csproj class library to a ASP.NET 5 RC1 xproj project and while attempting to add references to regualar .NET…
Steve W.
  • 413
  • 1
  • 5
  • 12
3
votes
2 answers

The type 'IEnumerable<>' is defined in an assembly that is not referenced. System.Runtime

I have an asp.net 5 web application that references a class library. That class library use Entity Framework 7 to perform a query. public IEnumerable GetMemberyByFirstName(string firstName) { var members = _context.Members.Where(m =>…
Bryan
  • 5,065
  • 10
  • 51
  • 68
3
votes
1 answer

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

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": { …
Matthew Verstraete
  • 6,335
  • 22
  • 67
  • 123
3
votes
2 answers

New .NET "project.json" project, copying pre-built native .dlls to the output directory

I'm looking to convert my project to use project.json format, but still using the .NET CLR until 3rd party dependencies add support for CoreCLR. With that said, some of my NuGet dependencies of files in the "content" directory that need to be output…
Paul Knopf
  • 9,568
  • 23
  • 77
  • 142
2
votes
4 answers

How to debug/fix 'An assembly with same simple name' has already been imported

I've used nuget install-package to install a package (let's call it PackageA) into a project. After install, my project.json file looks like this: { "dependencies": { "PackageA": "1.1.15" }, "frameworks": { "net45": {} }, …
ket
  • 728
  • 7
  • 22
2
votes
1 answer

When building a .NET Core self-contained deployment, are higher target OS versions better?

When creating a self-contained .NET Core deployment, you're required to specify a Runtime ID of your target platform, such as win7-x64 or win10-x64. We've found that these targets are backwards-compatible (I can run an application targeting win7-x64…
FLGMwt
  • 706
  • 4
  • 18
2
votes
1 answer

App won't start after removing Application Insights

I created an ASP.NET Core project using the templates in Visual Studio 2015, and checked the "Add Application Insights to project" checkbox by mistake. Later, I removed the Microsoft.ApplicationInsights.AspNetCore package from my project.json, and…
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
2
votes
1 answer

How to abort build when compilation of razor views fails?

I need to validate razor views during application build, so I used the tool described in the following article: http://dotnetthoughts.net/compile-your-aspnet-core-mvc-views/ but postpublish is too late for me, so I moved dotnet razor-precompile into…
Dawid
  • 93
  • 4