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.
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?
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