Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Edit .json file

$
0
0
I am having one VSIX project, which will made some changes in Project.json file of ASPNET5 project. am using the following to edit .json file.

   
ProjectJson jsonObj = JsonConvert.DeserializeObject<ProjectJson>(jsonContents);                    jsonObj = JsonConvert.DeserializeObject<ProjectJson>(jsonContents);                                                                var resultJson = JsonConvert.SerializeObject(jsonObj, Formatting.Indented);                                         JsonSerializer serializer = new JsonSerializer();         using (StreamWriter sw = new StreamWriter(projectObjects.ProjectJsonPath))                            {                                var writer = new JsonTextWriter(sw);                                serializer.Serialize(writer, resultJson);                                                          }                            // File.WriteAllText(projectObjects.ProjectJsonPath, resultJson);


by using both stream writer and writealltext am getting the following message in ASPNET 5 project 

>  The file has unsaved changes inside this editor and has been changed
> externally. do you want to reload it?

how to edit .json file without getting the above message?

Kani


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>