小编Ceo*_*aki的帖子

创建多项目Visual Studio模板时奇怪的文件夹层次结构

我正在为Visual Studio 2012手动创建一个多项目模板,我遵循了此页面的指南:http://msdn.microsoft.com/en-us/library/ms185308.aspx

我遇到的问题是使用此模板创建了一个奇怪的文件夹结构,这不是我通常所期望的.我得到的一个名为SolutionName的解决方案的文件夹结构:

[SolutionName]
     |
     \--- SolutionName.sln
     |
     \--- [SolutionName]
               |
               \--- Project1
               |       |
               |       \--- Project1.csproj
               \--- Project2
                       |
                       \--- Project2.csproj

现在,我通常会期待的是:

[SolutionName]
     |
     \--- SolutionName.sln
     |
     \--- Project1
     |       |
     |       \--- Project1.csproj
     \--- Project2
             |
             \--- Project2.csproj

有没有办法实现第二个文件夹结构?

此外,在模板中指定解决方案文件夹时,它们也被创建为真实文件夹,有什么办法可以避免这种情况吗?

这是我的多项目vstemplate文件的外观:

<?xml version="1.0"?>
<VSTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Type="ProjectGroup" Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
  <TemplateData>
    <Name>My Multi-Solution Template</Name>
    <Description>No Description.</Description>
    <Icon>__TemplateIcon.png</Icon>
    <PreviewImage>__PreviewImage.png</PreviewImage>
    <ProjectType>CSharp</ProjectType>
    <SortOrder>1000</SortOrder>
    <CreateNewFolder>true</CreateNewFolder> <!-- No use in trying false here. -->
    <DefaultName>SolutionName</DefaultName>
    <ProvideDefaultName>true</ProvideDefaultName>
    <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
    <LocationField>Enabled</LocationField>
  </TemplateData> …
Run Code Online (Sandbox Code Playgroud)

templates visual-studio-templates visual-studio-2012

10
推荐指数
1
解决办法
1896
查看次数

使用Angular的新HttpClient,如何在订阅事件时获取所有标头?

我使用Angular 4.3.2和新的HttpClient来下载作为流发送的文件,我需要获取标题(特别是Content-Disposition),但它们似乎没有出现在响应中,即使我可以在Chrome的开发工具中查看使用该请求正确发送的标头.

这是代码:

downloadDocument(documentId: number) {
    const downloadDocumentUrl = `${ this.config.apiUrls.documents }/${ documentId }`;
    const downloadRequest = new HttpRequest('GET', downloadDocumentUrl, {
        reportProgress: true,
        responseType: 'blob'
    });

    let percentageDownloaded = 0;
    this.http.request(downloadRequest).subscribe(
        (event: HttpEvent < any > ) => {
            if (event) {
                switch (event.type) {
                    case HttpEventType.ResponseHeader:
                        const contentDispositionHeader = event.headers.get('Content-Disposition');
                        console.log(contentDispositionHeader); // Always null here although I expected it to be there.
                        break;

                    case HttpEventType.DownloadProgress:
                        if (event.total) {
                            percentageDownloaded = Math.round((event.loaded / event.total) * 100);
                        }
                        break; …
Run Code Online (Sandbox Code Playgroud)

angular

7
推荐指数
1
解决办法
8804
查看次数