随笔 - 750  文章 - 1  评论 - 107  阅读 - 34万

[转] VS2008生成提速

转自:https://www.lmlphp.com/user/17260/article/item/514086/

测试有效,修改了line.99

1、在我的电脑,找到以下这个文件:

C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.CompactFramework.Common.targets

2、编辑该文件

复制代码
<!--
***********************************************************************************************
Microsoft.CompactFramework.common.targets

WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
          created a backup copy.  Incorrect changes to this file will make it
          impossible to load or build your projects from the command-line or the IDE.

Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
-->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <UsingTask TaskName="Microsoft.CompactFramework.Build.Tasks.GetDeviceFrameworkPath"   AssemblyName="Microsoft.CompactFramework.Build.Tasks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <UsingTask TaskName="Microsoft.CompactFramework.Build.Tasks.BuildAsmmeta"             AssemblyName="Microsoft.CompactFramework.Build.Tasks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <UsingTask TaskName="Microsoft.CompactFramework.Build.Tasks.PlatformVerificationTask" AssemblyName="Microsoft.CompactFramework.Build.Tasks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <UsingTask TaskName="Microsoft.CompactFramework.Build.Tasks.AddHighDPIResource"       AssemblyName="Microsoft.CompactFramework.Build.Tasks, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    <Target
        Name="GetFrameworkPaths"
        DependsOnTargets="$(GetFrameworkPathsDependsOn)"
     >
        <GetDeviceFrameworkPath
            FrameworkRegistryBase="$(FrameworkRegistryBase)"
            RuntimeVersion="$(TargetFrameworkVersion)"
            AssemblyFoldersSuffix="$(AssemblyFoldersSuffix)">
            <Output TaskParameter="Path" PropertyName="TargetFrameworkDirectory"/>
            <Output TaskParameter="Path" ItemName="TargetFrameworkDirectoryItem"/>
            <Output TaskParameter="Path" PropertyName="TargetFrameworkSDKDirectory"/>
            <Output TaskParameter="Path" ItemName="TargetFrameworkSDKDirectoryItem"/>
        </GetDeviceFrameworkPath>

        <CreateProperty Value="$(TargetFrameworkDirectory)">
            <Output TaskParameter="Value" PropertyName="FrameworkPathOverride"/>
        </CreateProperty>
    </Target>

    <!-- Override for GetReferenceAssemblyPaths in Microsoft.common.targets.
         For device projects, GetFrameworkPaths target is overridden (see above) 
         to populate the TargetFrameworkDirectory with paths containing reference 
         assemblies for device platforms.Device projects should not refer 
         desktop assemblies.
    -->
    <Target Name="GetReferenceAssemblyPaths" />

    <Target
        Name="AuthenticodeSign"
        Condition="'$(EnableSigning)'=='true' and '$(SigningCertHash)'!=''">

        <SignFile
            CertificateThumbprint="$(SigningCertHash)"
            TimestampUrl="$(SigningTimestampUrl)"
            SigningTarget="@(IntermediateAssembly)"
        />

        <SignFile
            Condition="'@(IntermediateSatelliteAssembliesWithTargetPath)'!=''"
            CertificateThumbprint="$(SigningCertHash)"
            TimestampUrl="$(SigningTimestampUrl)"
            SigningTarget="%(IntermediateSatelliteAssembliesWithTargetPath.FullPath)"
        />
    </Target>

    <Target
        Name="BuildAsmmeta"
        Condition="'@(None)'!=''">
        <BuildAsmmeta
            XmlSource="@(None)"
            Condition=" '%(None.Extension)' == '.xmta' "
            KeyFile="$(AssemblyOriginatorKeyFile)"
            PlatformFamilyName="$(PlatformFamilyName)"
            PlatformID="$(PlatformID)"
            NDPVersion="$(TargetFrameworkVersion)"
            SourceAssembly="@(IntermediateAssembly)"
            ReferencePath="@(ReferencePath)"
        >
            <Output TaskParameter="AsmmetaFile" PropertyName="AsmmetaFile" />
        </BuildAsmmeta>
    </Target>

    <!--
    Copy asmmeta files to output directory.
    -->
    <Target
        Name="CopyAsmmetaFilesToOutputDirectory"
        DependsOnTargets="BuildAsmmeta;CopyFilesToOutputDirectory">

        <!-- Copy the asmmeta files (*.asmmeta*.dll file) -->
        <Copy
            Condition="'$(AsmmetaFile)'!=''"
            SourceFiles="$(AsmmetaFile)"
            DestinationFolder="$(OutDir)"
            SkipUnchangedFiles="true"
        >
            <Output TaskParameter="DestinationFiles" ItemName="OutputAsmmetaFile"/>
        </Copy>
    </Target>

    <!-- 修改了这里: <Target Name="PlatformVerificationTask">-->
    <Target
        Name="PlatformVerificationTask" Condition="'$(SkipPlatformVerification)' == 'true'">
        <PlatformVerificationTask
            PlatformFamilyName="$(PlatformFamilyName)"
            PlatformID="$(PlatformID)"
            SourceAssembly="@(IntermediateAssembly)"
            ReferencePath="@(ReferencePath)"
            TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
            PlatformVersion="$(TargetFrameworkVersion)"/>
    </Target>

    <PropertyGroup>
        <ShouldAddHighDPIResource Condition="'$(TargetExt)_and_$(HighDPIResAware)_and_$(Win32Resource)'=='.exe_and_true_and_'">true</ShouldAddHighDPIResource>
        <ShouldAddHighDPIResource Condition="'$(TargetExt)_and_$(HighDPIResAware)_and_$(Win32Resource)_and_$(PlatformFamilyName)'=='.exe_and__and__and_PocketPC'">true</ShouldAddHighDPIResource>
        <ShouldAddHighDPIResource Condition="'$(TargetFrameworkVersion)'=='v1.0'">false</ShouldAddHighDPIResource>
    </PropertyGroup>

    <Target
        Name="AddHighDPIResource" Condition="'$(ShouldAddHighDPIResource)'=='true'">
        <AddHighDPIResource
            Win32Resource="$(Win32Resource)"
            ApplicationIcon="$(ApplicationIcon)"
            OutputDirectory="$(IntermediateOutputPath)">
            <Output TaskParameter="Win32Resource" PropertyName="Win32Resource" />
            <Output TaskParameter="ApplicationIcon" PropertyName="ApplicationIcon" />
        </AddHighDPIResource>
    </Target>

    <PropertyGroup>
        <!-- this value sets the default url behavior for newly added web references -->
        <DefaultUrlBehavior>Static</DefaultUrlBehavior>

        <!-- this value disables ApplicationSettings support. -->
        <SupportApplicationSettings>false</SupportApplicationSettings>

        <!-- Add our extra post-build tasks. -->
        <CoreBuildDependsOn>$(CoreBuildDependsOn);PlatformVerificationTask;BuildAsmmeta</CoreBuildDependsOn>

        <!-- Run the AddHighDPIResource target for v2 projects only -->
        <CoreBuildDependsOn Condition="'TargetFrameworkVersion'!='v1.0'">AddHighDPIResource;$(CoreBuildDependsOn)</CoreBuildDependsOn>
    </PropertyGroup>

    <!--
    Copy the build outputs to the final directory if they have changed.
    Overwrite to include copying asmmeta files built.
    -->
    <PropertyGroup>
        <PrepareForRunDependsOn>
            AuthenticodeSign;
            $(PrepareForRunDependsOn);
            CopyAsmmetaFilesToOutputDirectory
        </PrepareForRunDependsOn>
    </PropertyGroup>

    <!--
    AvailablePlatforms is the list of platform targets available.
    -->
    <PropertyGroup>
        <AvailablePlatforms>Any CPU</AvailablePlatforms>
        <CustomAfterMicrosoftCompactFrameworkCommonTargets Condition="'$(CustomAfterMicrosoftCompactFrameworkCommonTargets)'==''">$(MSBuildExtensionsPath)\v2.0\Custom.After.Microsoft.CompactFramework.Common.targets</CustomAfterMicrosoftCompactFrameworkCommonTargets>
    </PropertyGroup>

    <Import Project="$(CustomAfterMicrosoftCompactFrameworkCommonTargets)" Condition="Exists('$(CustomAfterMicrosoftCompactFrameworkCommonTargets)')"/>
</Project>
复制代码

 

posted on   z5337  阅读(40)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示