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 ?
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.
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.
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.
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.
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>
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With