Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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 ?

like image 763
aspxsushil Avatar asked Nov 20 '16 00:11

aspxsushil


People also ask

Where can I find project JSON file?

Project. json is an automatically generated file which is included in the folder of each automation project made in Studio. The file holds information about the project dependencies, and web services loaded in libraries.

Where does project assets JSON come from?

json file is generated in the process of restoring the NuGet packages in projects that use project. json . It holds a snapshot of all the information that is generated as NuGet walks the graph of packages and includes the version, contents, and dependencies of all the packages in your project.

What is project JSON file in ASP NET MVC?

json file. This file is using JavaScript object notation to store configuration information and it is this file that is really the heart of a . NET application. Without this file, you would not have an ASP.NET Core project.

How do I open a Csproj file in Visual Studio?

You should be able to do this by right clicking the project in the Solution window and selecting Tools - Edit File. That will open the project file (. csproj) in the text editor.


2 Answers

Going forward, .Net Core is going to be based on msbuild, which means that it's going to use *.csproj instead of project.json. Package references are now also stored in the *.csproj file.

For more information, read Announcing .NET Core Tools MSBuild “alpha” on the .NET Blog and High level overview of changes in CLI Preview 3 in .NET Documentation.

For example, if you had this in your project.json:

"dependencies": {   "Microsoft.NETCore.App": {     "type": "platform",     "version": "1.0.0"   },   "Newtonsoft.Json": "9.0.1" } 

You will now have *.csproj containing:

<PackageReference Include="Microsoft.NETCore.App">   <Version>1.0.1</Version> </PackageReference> <PackageReference Include="Microsoft.NET.Sdk">   <Version>1.0.0-alpha-20161104-2</Version>   <PrivateAssets>All</PrivateAssets> </PackageReference> <PackageReference Include="Newtonsoft.Json">   <Version>9.0.1</Version> </PackageReference> 
like image 64
svick Avatar answered Oct 19 '22 12:10

svick


Refer Given Link

https://docs.microsoft.com/en-us/dotnet/core/tools/project-json-to-csproj

Project.json

{   "buildOptions": {     "warningsAsErrors": true,     "nowarn": ["CS0168", "CS0219"],     "xmlDoc": true,     "preserveCompilationContext": true,     "outputName": "Different.AssemblyName",     "debugType": "portable",     "allowUnsafe": true,     "define": ["TEST", "OTHERCONDITION"]   } } 

Solution->Right Click ->Edit Project.csporj

<PropertyGroup>   <TreatWarningsAsErrors>true</TreatWarningsAsErrors>   <NoWarn>$(NoWarn);CS0168;CS0219</NoWarn>   <GenerateDocumentationFile>true</GenerateDocumentationFile>   <PreserveCompilationContext>true</PreserveCompilationContext>   <AssemblyName>Different.AssemblyName</AssemblyName>   <DebugType>portable</DebugType>   <AllowUnsafeBlocks>true</AllowUnsafeBlocks>   <DefineConstants>$(DefineConstants);TEST;OTHERCONDITION</DefineConstants> </PropertyGroup> 
like image 41
Muhamed Shafeeq Avatar answered Oct 19 '22 11:10

Muhamed Shafeeq