Last active
October 3, 2022 02:43
-
-
Save jtheisen/c7cd84d1c66598b045a360cca9ba8ef4 to your computer and use it in GitHub Desktop.
To be put in an AfterBuild task, it generates the necessary dummy files for ngen-ing a web application and gives the full shell commands to do it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ngen --> | |
<Copy SourceFiles="$(MSBuildProjectDirectory)\Web.config" DestinationFiles="$(OutDir)$(AssemblyName).dummy.exe.config" /> | |
<Copy SourceFiles="$(OutDir)$(AssemblyName).dll" DestinationFiles="$(OutDir)$(AssemblyName).dummy.exe" /> | |
<GetFrameworkPath> | |
<Output | |
TaskParameter="Path" | |
PropertyName="FrameworkPath" /> | |
</GetFrameworkPath> | |
<PropertyGroup> | |
<NgenUpdateCommand>"$(FrameworkPath)\ngen.exe" update</NgenUpdateCommand> | |
<NgenAbsoluteCommand>"$(FrameworkPath)\ngen.exe" install "$(MSBuildProjectDirectory)\$(OutDir)\$(AssemblyName).dll" "/ExeConfig:$(MSBuildProjectDirectory)\$(OutDir)\$(AssemblyName).dummy.exe"</NgenAbsoluteCommand> | |
<NgenRelativeCommand>"$(FrameworkPath)\ngen.exe" install "$(OutDir)\$(AssemblyName).dll" "/ExeConfig:$(OutDir)\$(AssemblyName).dummy.exe"</NgenRelativeCommand> | |
</PropertyGroup> | |
<Message Text="To ngen locally, run as admin: $(NgenAbsoluteCommand)" Importance="high" /> | |
<Message Text="To ngen deployed, cd to deployment and run as admin: $(NgenRelativeCommand)" Importance="high" /> | |
<Message Text="In both cases, subsequence updates can also be achieved with the longer-runnning update command: $(NgenUpdateCommand)" Importance="high" /> | |
<!-- /ngen --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment