How to build SCOM 2012 management pack using msbuild? - visual-studio-2013

I have a Visual Studio project which I'm building with Visual Studio and everything works fine. When I'm trying to build it using msbuild.exe /t:Build F:\BuildSource\SCOMManagementPacks\2012\Packs.sln I'm getting the following errors:
C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(223,5): error MSB4018: T
he "VerifyManagementPackFragment" task failed unexpectedly.\r [F:\BuildSource\SCOMManagementPacks\2012\Zabbix.Linux.
Library\Zabbix.Linux.Library.mpproj]
C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(223,5): error MSB4018: System.IO.FileNotFoundException: Could not find file 'F:\BuildSource\SCOMManagementPacks\2012\Zabbix.Linux.Library\Fr
agmentSchemaOM20.xsd'.\r [F:\BuildSource\SCOMManagementPacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mppro
j]
There's no such file on my original machine where I was building the solution using Visual Studio and everything's building fine.
How can I fix this?

Related

Build Failed after adding Kapsel Plugins to Cordova Project - Could not find SDK "Microsoft.VCLibs, Version=12.0"

I'm trying to make a Windows Cordova build using cmd but I'm getting below errors. Can any of you please guide me on how to fix this issue.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(
2377,5): error MSB3774: Could not find SDK "Microsoft.VCLibs, Version=12.0".
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe: Command failed with exit code 1
PS: I'm using Visual Studio Community 2017.

Getting "error MSB3030: Could not copy the file" when no Copy is provided in project

After migrating project from Visual Studio 2015 to Visual Studio 2015 I started to get the following error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(4358,5): error MSB3030: Could not copy the file "C:\p4client\ProAudio\dev_main_2018\ProAudio\XPlatform\AudioGrid\sdk\Project\Win\ag_sgring.pb.cc ag_sgring_pb2.py" because it was not found.
However, in no place in project copy step was not specified.
How can I find out what is asking this copy step and disable it?
Was there any change between VS 2015 and VS 20017 in copy tasks?

Could not load file or assembly 'Microsoft.CodeAnalysis" in visual studio 2015

I am creating an android app in visual studio 2015. While building the solution I am getting this error :
The specified task executable "csc.exe" could not be run. Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I have update my visual studio as well. but nothing is working for me.
Here is snapshot of error:
try to run visual studio as administrator or repair your visual studio from programs
see this post:
Visual Studio 2012 csc.exe Error. Executable not valid for OS

MsBuild with Visual Studio 2012 Package Project

I have created .NET solution with Visual Studio 2012 Package Project (From VS2012 SDK). With Visual Studio I successfully compile and run this project (along with entire solution) in "Debug" configuration mode, and for "Any CPU" platform. But when I try to build solution in command line using MsBuild, I get errors:
Command:
msbuild MySolution.sln /p:Configuration=Debug /p:Platform="Any CPU"
Errors:
error : Can not find the installation for VS SDK.
error MSB4018: The "FindVsSDKInstallation" task fail
ed unexpectedly.
error MSB4018: System.ArgumentNullException: Value can
not be null.
error MSB4018: Parameter name: path1
error MSB4018: at System.IO.Path.Combine(String pat
h1, String path2)
error MSB4028: The "FindVsSDKInstallation" task's ou
tputs could not be retrieved from the "IncludesPath" parameter. Value cannot be
null.
error MSB4028: Parameter name: path1
All activities are performed on my local Windows 7, with VS2012 and SDK installed.
I was looking for solution on the Web and I have found the following topic: FindVsSDKInstallation task fails on the build box. There is said that such a project should be compiled for "x86" platform, because devenv.exe process is 32-bit. So I change a Platform Target property from Project Properties to "x86" (for "Debug" mode). The result is the same - project is built successfully in VS but not in MsBuild.
Why VS2012 Package project is properly built by using VS, but MsBuild fails? How should I run MsBuild to build it successfully?
First, you need to use a visual studio command prompt, or call the vsvars batch file e.g.
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"
Second, the link you gave also says
"I think setting the "VsSDKInstall" environment variable should work
too"
There's a related post here

FxCop - How to resolve Windows, Version 255.255.255.255?

I am trying to get FxCop 10 to run analysis on a Windows 8 build computer and seem to have run up against a wall.
When I run it with /verbose against a dll, I get:
Could not resolve reference to Windows. Could not load [path to my dll]. The following error was encountered while reading module [name of my module]: Assembly reference cannot be resolved: Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null
I have it pointing to the VS 2012 minimum recommended rules and can get it to run code analysis from visual studio if I set the FxCopCmd.exe.config:
Here is my command line version, which produces the error mentioned above:
fxcopcmd /file:"D:\Source\Project\bin\release\myproject.dll" /out:"D:\temp\fxcop-report.xml" /rs:="C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Static Analysis Tools\Rule Sets\MinimumRecommendedRules.ruleset" /s /assemblyCompareMode:StrongNameIgnoringVersion /searchgac /verbose
I get prompted for Windows, Version 255.255.255.255 if I try to run analysis using the FxCop application as well.
This is a Windows 8 Phone project.
Try adding this switch to your FxCopCmd command:
/directory:"C:\Program Files (x86)\Windows Phone Kits\8.0\Windows MetaData"
That worked for me when I met the same error running Visual Studio Code Metrics Powertool for Visual Studio 2013 (metrics.exe).

Resources