Visual Studio 2017 msbuild package sharepoint - visual-studio

I have a simple SharePoint 2013 solution which I can publish through Visual Studio - this will generate .wsp for me. However when I am trying to run build by the command:
msbuild /t:Package mySolution.sln
Build is ok but during packaging I receive an error:
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.
If I put this missing dll to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools then I receive another error about another missing dll...
What am I doing wrong?

Looks like this is MSBuild issue:
1.Open elevated command prompt
2.Navigate to your SDK tools
cd "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64"
Sn -Vr "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Modeling.Sdk.15.0.dll"
gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Modeling.Sdk.15.0.dll"
For the following three dlls, please do same behavior from step 3 to 4
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SharePoint.dll
Note if Microsoft.VisualStudio.SharePoint.dll not found in above path, check in
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
Now you can MSBuild your SharePoint 2016 solutions by VS command promp.
Check Link, that's for Sharepoint 2016, but same works for 2013 as well: https://developercommunity.visualstudio.com/content/problem/40195/cant-use-msbuild-to-package-sharepoint-2016-soluti.html

Related

Visual Studio 2017 doesn't see SDK

I have Visual Studio 2017 Community Edition; along with a bunch of SDKs:
> dir "C:\Program Files (x86)\Windows Kits\10\Include"
10.0.10150.0
10.0.10586.0
10.0.15063.0
10.0.17134.0
10.0.10240.0
10.0.14393.0
10.0.16299.0
10.0.17763.0
However, "Командная строка разработчика для VS 2017" (VsDevCmd.bat) doesn't see my SDK. Environment variables:
IFCPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ifc\x86
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\store\references;C:\Windows\Microsoft.NET\Framework\v4.0.30319;
resulting in
fatal error C1083: Не удается открыть файл включение: sys/types.h: No such file or directory
on compilation with cl.exe.
Are any additional steps needed to configure SDKs for Visual Studio 2017?
Quite unexpectedly, the problem was in
C:\Windows\System32
missing from PATH.
set VSCMD_DEBUG=3
helped to pin down the issue.

Missing Clickonce prerequisites in Visual Studio 2013

I have installed Visual Basic PowerPacks 10.0. It appears as a Clickonce Prerequisite in Visual Studio 2010 but in Visual Studio 2013 Professional It has the yellow triangle next to it and an error is generated when I build my project.
Any help appreciated.
I found a work around. I went to the bootstrapper directory located here:
C:\Program Files (x86)\Microsoft SDKs\Windows\
Visual Studio 2013 looks here for the bootstrapper packages: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\
Inside C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\ I found the VBPowerPacks folder and copied it to C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\
Not sure why VBPowerPacks does not automatically install in all Bootstrapper folders. That would have saved me a great deal of time.

VS2012 doesn't include winres.h any more?

After installing VS2012, I can't find winres.h under folder "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC". What happen to VS2012 and why remove this header file?
By the way, in VS2010, winres.h locates in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include"
The file is part of the Windows SDK now and since VS2012 the SDK location is different, it's now called a 'Kit' and is found in Program Files/Windows Kits. Sepcifically you can find winres.h in
C:\Program Files (x86)\Windows Kits\8.0\Include\um

How do I fix the "Prerequisite cannot be found for bootstrapping" warning in Visual Studio 2010?

I am using:
Visual Studio 2010 on a x64 machine
Building a Windows Application
Targeting .NET Framework 4 Client Profile and x86.
I am deploying with ClickOnce.
I have installed the "Microsoft Windows SDK for Windows 7 (7.1)".
Here is my problem:
On an old project, on the project properties, Publish tab, Prerequisites... button, I open this dialog box. All the listed prerequisites have a yellow, triangular warning, stating, "Prerequisite cannot be found for bootstrapping". The effect is that the ClickOnce setup.exe cannot correctly install the prerequisites for users.
If I create a new, empty project from scratch, the Prerequisites box is empty.
Here is information about various folders:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages contains all the bootstrap packages.
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages contains all the bootstrap packages.
C:\Program Files\Microsoft SDKs\Windows\v7.1 did not have a Bootstrapper folder.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\SDK that has nothing in it but an empty v3.5 folder .
Environment WindowsSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\
Registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\4.0\Path = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
Here is what I have tried:
I have tried copying the Bootstrapper folder from C:\Program Files\Microsoft SDKs\Windows\v7.0A\ to C:\Program Files\Microsoft SDKs\Windows\v7.1 but that did not make a difference.
I have tried copying the Bootstrapper folder from C:\Program Files\Microsoft SDKs\Windows\v7.0A\ to C:\Program Files (x86)\Microsoft Visual Studio 10.0\SDK\v4.0. That did not make a difference.
Any suggestions?
Try this:
make the prerequisites with bootstrapper manifest generator
then add them into C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Bootstrapper\Packages folder
If it works please notify by comment..

How Can I Modify the Default UnitTest1.cs File Template in the Visual Studio 2010 C# Test Project Template?

I know I can export my own project template, but I'd like to know how to edit the actual, Visual Studio Test Project template's C# UnitTest1.cs file. I've been unable to locate it in my C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE folder tree. Anybody know where this lives so I can modify it?
Try C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\1033\BasicUnitTest.zip
Or
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\1033\SimpleUnitTest.zip
Extract the files from Archive,
Change the SimpleUnitTest.cs as you want
Back up the old SimpleUnitTest.zip
Zip back the now changed files and name the Archive SimpleUnitTest.zip and copy it to the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\1033\ location.
After that:
Back up the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\1033\SimpleUnitTest.zip folder
copy the changed, unnpacked items (in your case SimpleUnitTest.cs) over to the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\1033\SimpleUnitTest.zip.

Resources