2017-03-13 139 views
2

我有一個簡單的SharePoint 2013解決方案,我可以通過Visual Studio發佈 - 這將爲我生成.wsp。然而,當我試圖運行由命令建立:Visual Studio 2017 msbuild包sharepoint

msbuild /t:Package mySolution.sln 

打造的是確定,但包裝過程中我收到一個錯誤:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets(190,5): error : Could not load file or assembly 'Microsoft.VisualStudio.Modeling.Sdk.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

如果我把這個缺少DLL到C:\ Program Files文件( x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio \ v15.0 \ SharePointTools然後我收到另一個錯誤關於另一個缺失的DLL ... 我做錯了什麼?

+0

這裏的同樣的錯誤:HTTPS://developercommunity.visualstudio.com/content/problem/28775/can-not -create-WSP-包換的SharePoint-2013-pro.html。 Visual Studio團隊已確定此問題與SharePoint/Modeling SDK相關。所以我們建議您可以跟進SharePoint/Modeling SDK團隊的論壇。 –

+0

我有同樣的問題,並在其論壇上提出問題:https://social.msdn.microsoft.com/Forums/office/en-US/f2394040-10db-45a2-bf92-5524f79200ad/building-wsps-via-命令行與vs2017?forum = sharepointdevelopment(希望這是正確的) –

回答

1

看起來這是MSBuild的問題: 1.Open提升的命令提示符

2.Navigate到SDK工具

CD「C:\ Program Files文件(x86)的\微軟的SDK \的Windows \ V10 「\ Program Files \ x86 \ Microsoft Visual Studio \ 2017 \ Enterprise \ Common \ Microsoft \ Visual Studio \ 2017 \ Enterprise \ x64」\ Novell \ NETFX 4.6.1 Tools \ x64「

  1. Sn- IDE \ PrivateAssemblies \ Microsoft.VisualStudio.Modeling.Sdk.15.0.dll「

  2. GACUTIL/I 「C:\ Program Files文件(x86)的\微軟的Visual Studio \ 2017年\企業\ Common7 \ IDE \ PrivateAssemblies \ Microsoft.VisualStudio.Modeling.Sdk.15.0.dll」

  3. 對於以下3個dll文件,請做同樣的行爲從步驟3至4

C:\ Program Files文件(x86)的\微軟的Visual Studio \ 2017年\企業\ Common7 \ IDE \ PublicAssemblies \ Microsoft.VisualStudio.SharePoint.dll

注意如果Microsoft.VisualStudio.SharePoint.dll找不到上述路徑,請檢查
C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio \ v15.0 \ SharePointTools \ Microsoft.VisualStudio.SharePoint.dll

C:\ Program Files(x86) Microsoft Visual Studio \ 2017 \ Enterprise \ Common7 \ IDE \ PrivateAssemblies \ Microsoft.VisualStudio.SharePoint.Designers.Models.dll C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ Common7 \ IDE \ PrivateAssemblies \ Microsoft .VisualStudio.SharePoint.Designers.Models.Features.dll

  1. 現在,您可以使用VS命令promp來構建您的SharePoint 2016解決方案。

檢查鏈接,這對於SharePoint 2016年,但2013年同樣的作品還有:https://developercommunity.visualstudio.com/content/problem/40195/cant-use-msbuild-to-package-sharepoint-2016-soluti.html