Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the project.json file in an asp.net 5 (dnx) project be moved?

The default location of project.json is in the root folder of the asp.net project folder. I dislike having configuration files jumbled in with classes and would prefer to move project.json (and other configuration and startup elements) to a Configuration folder.

I moved project.json (in visual studio solution explorer) to a /Configuration folder but it results in the following error:

C:\Program Files (x86)\MSBuild\Microsoft...\DNX\Microsoft.DNX.targets(142,5):
error : The design time host build failed with the following error:
Unable to find project.json in 'Z:\path\to\project\root'

I can't seem to find any configuration detail to indicate where the project.json is located. With all the extensibility and customization possible in the new frameworks did Microsoft hardcode the location of the project.json file?

like image 921
Gerald Davis Avatar asked May 14 '15 15:05

Gerald Davis


People also ask

What can you do using the project json file for an ASP NET application?

json” file in ASP.NET 5 ASP.NET Core 1.0. This new file the way to define your dependencies, managing your runtime frameworks, compilation settings, adding scripts to execute at different events (Prebuild, Postbuild etc.)

What is project json file in .NET core?

json file used by NuGet is a subset of that found in ASP.NET Core projects. In ASP.NET Core project. json is used for project metadata, compilation information, and dependencies. When used in other project systems, those three things are split into separate files and project.

How do I open a project json file?

Right click your project and select "Edit ProjectName. csproj" to view the file.

Which json file helps you installs the right versions of the packages you need and their dependencies?

Bower is a package manager for the web. Bower can manage components that contain HTML, CSS, JavaScript, fonts or even image files. Bower doesn't concatenate or minify code or do anything else – it just installs the right versions of the packages you need and their dependencies.


1 Answers

Short answer is "no". The new project system assumes two things: (1) folder name = project name and (2) project.json is in that folder. project.json is not a configuration file. It is the project metadata just like csproj is for C# projects

While you still need to have a folder named as the project with a project.json file inside it, you can always include source files from other folders, outside of the project folder. Here's an example of how to do that.

like image 186
Victor Hurdugaci Avatar answered Oct 19 '22 08:10

Victor Hurdugaci