Configure NuGet package to add a build event when installed
I follow Paul's answer and do it
$project.Properties.Item("PreBuildEvent").Value = "your build event here"
Below is my install.ps1
$project.Properties.Item("PreBuildEvent").Value = "IF $(ConfigurationName) == Debug IF $(PlatformName) == ARM goto DebugARM
IF $(ConfigurationName) == Debug IF $(PlatformName) == x86 goto Debugx86
IF $(ConfigurationName) == Release IF $(PlatformName) == ARM goto ReleaseARM
IF $(ConfigurationName) == Release IF $(PlatformName) == x86 goto Releasex86
:DebugARM
echo build SDK-DebugARM
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\lib\arm\debug\LibMap.dll $(ProjectDir)LibMap.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\arm\debug\AMapSDKV2Comp.dll $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\arm\debug\AMapSDKV2Comp.winmd $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.winmd /Y
exit 0
:Debugx86
echo build SDK-Debugx86
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\lib\x86\debug\LibMap.dll $(ProjectDir)LibMap.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\x86\debug\AMapSDKV2Comp.dll $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\x86\debug\AMapSDKV2Comp.winmd $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.winmd /Y
exit 0
:ReleaseARM
echo build SDK-ReleaseARM
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\lib\arm\release\LibMap.dll $(ProjectDir)LibMap.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\arm\release\AMapSDKV2Comp.dll $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\arm\release\AMapSDKV2Comp.winmd $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.winmd /Y
exit 0
:Releasex86
echo build SDK-Releasex86
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\lib\x86\release\LibMap.dll $(ProjectDir)LibMap.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\x86\release\AMapSDKV2Comp.dll $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.dll /Y
copy $(SolutionDir)packages\AMap.2.2.0\AMAP3DEngine\references\x86\release\AMapSDKV2Comp.winmd $(SolutionDir)packages\AMap.2.2.0\lib\AMapSDKV2Comp.winmd /Y
exit 0"
but i find that in my vs2013,it shows like:
seems like remove all the "$value"
Could u tell me how to solve this?
I want that content in my install.ps1 is same with content in pre build event in my vs