Created
July 1, 2017 20:24
-
-
Save nils-a/334bc0f8b7d3a011b97511cf695fb219 to your computer and use it in GitHub Desktop.
for VS2017 you seem to nees to add some assemblies to the gac. See https://developercommunity.visualstudio.com/content/problem/40195/cant-use-msbuild-to-package-sharepoint-2016-soluti.html
This file contains 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
@ECHO OFF | |
if not "%VSINSTALLDIR%"=="" goto nodetection | |
FOR %%P IN ("%ProgramFiles(x86)%", "%ProgramFiles%") do ( | |
::ECHO %%P | |
FOR %%E IN ("Professional","Enterprise") do ( | |
::ECHO %%E | |
if exist "%%~P\Microsoft Visual Studio\2017\%%~E\Common7\Tools\VsDevCmd.bat" ( | |
::SET BASE="%%P\Microsoft Visual Studio\2017\%%E\Common7\IDE" | |
call "%%~P\Microsoft Visual Studio\2017\%%~E\Common7\Tools\VsDevCmd.bat" | |
) | |
) | |
) | |
:nodetection | |
ECHO VS2017 found in %VSINSTALLDIR% | |
FOR %%F IN ("%VSINSTALLDIR%\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Modeling.Sdk.15.0.dll", | |
"%VSINSTALLDIR%\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SharePoint.dll", | |
"%VSINSTALLDIR%\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools\Microsoft.VisualStudio.SharePoint.dll", | |
"%VSINSTALLDIR%\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.SharePoint.Designers.Models.dll", | |
"%VSINSTALLDIR%\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.SharePoint.Designers.Models.Features.dll") DO ( | |
if exist "%%~F" ( | |
sn -Vr "%%~F" | |
gacutil /i "%%~F" | |
) else ( | |
echo skipped "%%~F" | |
) | |
) | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment