public string EnsureFileGeneratedAndGetUrl(string localFileSystemPath, Project project) { var url = localFileSystemPath + ".html"; url = url.Replace(":", ""); url = url.Replace(" ", ""); // need these because IIS refuses to render static files that have \bin\ in the path url = url.Replace(@"\bin\", @"\bin_\"); url = url.Replace(@"\Bin\", @"\Bin_\"); if (url.StartsWith(@"\\", StringComparison.Ordinal)) { url = url.Substring(2); } url = Constants.MSBuildFiles + @"\" + url; var htmlFilePath = Path.Combine(SolutionDestinationFolder, url); if (!File.Exists(htmlFilePath)) { var msbuildSupport = new MSBuildSupport(ProjectGenerator); msbuildSupport.Generate(localFileSystemPath, htmlFilePath, project, false); } url = "/" + url.Replace('\\', '/'); return(url); }
public string EnsureFileGeneratedAndGetUrl(string localFileSystemPath, Project project) { var url = localFileSystemPath + ".html"; url = url.Replace(":", ""); url = url.Replace(" ", ""); url = url.Replace(@"\bin\", @"\bin_\"); if (url.StartsWith(@"\\")) { url = url.Substring(2); } url = Constants.MSBuildFiles + @"\" + url; var htmlFilePath = Path.Combine(SolutionDestinationFolder, url); if (!File.Exists(htmlFilePath)) { var msbuildSupport = new MSBuildSupport(this.projectGenerator); msbuildSupport.Generate(localFileSystemPath, htmlFilePath, project, false); } url = "/" + url.Replace('\\', '/'); return(url); }
private void GenerateProjectFile() { var projectExtension = Path.GetExtension(ProjectFilePath); if (!File.Exists(ProjectFilePath) || ".dll".Equals(projectExtension, StringComparison.OrdinalIgnoreCase) || ".winmd".Equals(projectExtension, StringComparison.OrdinalIgnoreCase)) { return; } ProjectCollection projectCollection = null; try { var title = Path.GetFileName(ProjectFilePath); var destinationFileName = Path.Combine(ProjectDestinationFolder, title) + ".html"; AddDeclaredSymbolToRedirectMap(SymbolIDToListOfLocationsMap, SymbolIdService.GetId(title), title, 0); // ProjectCollection caches the environment variables it reads at startup // and doesn't re-get them later. We need a new project collection to read // the latest set of environment variables. projectCollection = new ProjectCollection(); this.msbuildProject = new Project( ProjectFilePath, null, null, projectCollection, ProjectLoadSettings.IgnoreMissingImports); var msbuildSupport = new MSBuildSupport(this); msbuildSupport.Generate(ProjectFilePath, destinationFileName, msbuildProject, true); GenerateXmlFiles(msbuildProject); GenerateXamlFiles(msbuildProject); GenerateResxFiles(msbuildProject); GenerateTypeScriptFiles(msbuildProject); OtherFiles.Add(title); } catch (Exception ex) { Log.Exception("Exception during Project file generation: " + ProjectFilePath + "\r\n" + ex.ToString()); } finally { if (projectCollection != null) { projectCollection.UnloadAllProjects(); projectCollection.Dispose(); } } }
private void GenerateProjectFile() { var projectExtension = Path.GetExtension(ProjectFilePath); if (!File.Exists(ProjectFilePath) || ".dll".Equals(projectExtension, StringComparison.OrdinalIgnoreCase) || ".winmd".Equals(projectExtension, StringComparison.OrdinalIgnoreCase)) { return; } ProjectCollection projectCollection = null; try { var title = Path.GetFileName(ProjectFilePath); var destinationFileName = Path.Combine(ProjectDestinationFolder, title) + ".html"; AddDeclaredSymbolToRedirectMap(SymbolIDToListOfLocationsMap, SymbolIdService.GetId(title), title, 0); // ProjectCollection caches the environment variables it reads at startup // and doesn't re-get them later. We need a new project collection to read // the latest set of environment variables. projectCollection = new ProjectCollection(); this.msbuildProject = new Project( ProjectFilePath, null, null, projectCollection, ProjectLoadSettings.IgnoreMissingImports); var msbuildSupport = new MSBuildSupport(this); msbuildSupport.Generate(ProjectFilePath, destinationFileName, msbuildProject, true); GenerateXamlFiles(msbuildProject); GenerateTypeScriptFiles(msbuildProject); OtherFiles.Add(title); } catch (Exception ex) { Log.Exception("Exception during Project file generation: " + ProjectFilePath + "\r\n" + ex.ToString()); } finally { if (projectCollection != null) { projectCollection.UnloadAllProjects(); projectCollection.Dispose(); } } }
public void GenerateMsBuildProject(ProjectCollection projectCollection) { var title = Path.GetFileName(ProjectFilePath); var destinationFileName = Path.Combine(ProjectDestinationFolder, title) + ".html"; AddDeclaredSymbolToRedirectMap(SymbolIDToListOfLocationsMap, SymbolIdService.GetId(title), title, 0); // ProjectCollection caches the environment variables it reads at startup // and doesn't re-get them later. We need a new project collection to read // the latest set of environment variables. this.msbuildProject = new Project( ProjectFilePath, null, null, projectCollection, ProjectLoadSettings.IgnoreMissingImports); var msbuildSupport = new MSBuildSupport(this); msbuildSupport.Generate(ProjectFilePath, destinationFileName, msbuildProject, true); }
public string EnsureFileGeneratedAndGetUrl(string localFileSystemPath, Project project) { var url = localFileSystemPath + ".html"; url = url.Replace(":", ""); url = url.Replace(" ", ""); url = url.Replace(@"\bin\", @"\bin_\"); if (url.StartsWith(@"\\")) { url = url.Substring(2); } url = Constants.MSBuildFiles + @"\" + url; var htmlFilePath = Path.Combine(SolutionDestinationFolder, url); if (!File.Exists(htmlFilePath)) { var msbuildSupport = new MSBuildSupport(this.projectGenerator); msbuildSupport.Generate(localFileSystemPath, htmlFilePath, project, false); } url = "/" + url.Replace('\\', '/'); return url; }