Add a targets file to your project named My.build.targets to add content to the targets file:
<?xml version= "1.0" encoding= "Utf-8"?> <project xmlns= "http://schemas.microsoft.com/developer/msbuild/" 2003 "> <ItemGroup> <cityindexjs include=" js/src/cityindex/_*.js;js/src/cityindex/i*.js;js/src/ Cityindex/page.js;js/src/cityindex/ready.js "/> </ItemGroup> <target name=" Buildjs "condition=" ' $ ( Configuration) ' = = ' release ' > <message text= ' building javascript files ... haha ' ></Message> <pack
Er outputfilename= "js\cityindex.js" mode= "jsmin" inputfiles= "@ (CITYINDEXJS)" verbose= "true"/> </Target> <PropertyGroup> <webconfigpath>$ (samplefilesdir) \web.config</webconfigpath> </propertygroup > <target name= "updatereleasewebconfig" condition= "' $ (Configuration) ' = = ' Release '" > <message text= "upda Ting Web config ... haha "></Message> <updatewebconfig webconfigpath=" web.config "debug=" Fals E "customerrorsmode=" Remote/> </Target> ≪/project>
Copy the Smallsharp file to a directory, such as Mylib.dll\msbuild\smallsharp download address unload project, and edit the project file to join at the top of the project file
<import project= ". \ document \msbuild\smallsharp\msbuild.packer.targets "/>
<import project= js.build.targets"/>
Add at the bottom of the project file
<target name= "Afterbuild" >
<calltarget targets= "Updatereleasewebconfig"/>
<calltarget targets= "Buildjs"/>
</Target>
Executes using MSBuild, because the configuration=release pattern is used here, so you need to specify the parameters
MSBuild My.csproj/p:configuration=release
Direct compilation In this vs will not perform compression and will only be performed through MSBuild