public DotvvmProjectMetadata CreateDefaultConfiguration(string directory) { var metadata = new DotvvmProjectMetadata() { Version = 1, ProjectDirectory = directory, MetadataFilePath = Path.Combine(directory, MetadataFileName) }; // find *.csproj file in the directory var csprojService = new CSharpProjectService(); var csproj = csprojService.FindCsprojInDirectory(directory); if (csproj != null) { csprojService.Load(csproj); metadata.RootNamespace = csprojService.GetRootNamespace(); metadata.ProjectName = csprojService.GetAssemblyName(); } return(metadata); }
public void Save(DotvvmProjectMetadata metadata) { File.WriteAllText(metadata.MetadataFilePath, JsonConvert.SerializeObject(metadata, Formatting.Indented)); }