Question

Dziki_Jam on Tue, 31 Jan 2017 14:43:05


I have a Visual Studio 2012 solution with multiple management packs in it. Everything works fine when I build it in Visual Studio. When I'm building it running msbuild in VS2012 Native Tools Command Prompt everything works fine too. The problem appears when I'm trying to build it using an msbuild from regular cmd.

So, at first, I was getting multiple errors (for every management pack in solution):

C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(210,5): error MSB4018: The "VerifyManagementPackFragment" task failed unexpectedly.\r [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(210,5): error MSB4018: System.IO.FileNotFoundException: Could not find file 'D:\Desktop\scom_managementpacks\2012\WK.Zabbix.Linux.Library\FragmentSchemaOM20.xsd'.\r [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(210,5): error MSB4018: File name: 'D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\FragmentSchemaOM20.xsd'\r [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]

After I put FragmentSchemaOM20.xsd (I took it from VSAE installation) to location I started getting the following error:

01.MPName.mpx(2729,20): error : Undefined complexType 'http://schemas.microsoft.com/maml/2004/10:sectionsType' is usedas a base for complex type restriction. [D:\Desktop\scom_managementpacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mpproj]

The thing is there's MPName.mpx file has only 11 lines. I did some investigation and found out that actually, this error is pointing to FragmentSchemaOM20.xsd that I put to the folder.

How can I fix this? What is the proper way to build management packs with msbuild?

I've tried to build the whole solution pointing to .sln file and a separate project, pointing to a single .mpproj file. Example command:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /t:Build D:\Desktop\scom_managementpacks\2012\Apache.WebServer.Discovery.And.Monitoring\Apache.WebServer.Discovery.And.Monitoring.mpproj


Sponsored



Replies

Zhanglong Wu on Fri, 03 Feb 2017 01:48:22


Hi Dziki_Jam,

Based on your error message, it seems that it is a xsd error, please check the similar issue as below.

http://stackoverflow.com/questions/23867843/error-parsing-an-xsd-schema-undefined-complextype#

Best regards,

Cole Wu

Dziki_Jam on Fri, 03 Feb 2017 06:53:39


The thing is this xsd file was provided by Microsoft in VSAE package and works fine with Visual Studio but when I'm building it with MSBuild it shows that error.

Zhanglong Wu on Tue, 07 Feb 2017 08:23:04


Hi Dziki_Jam,

>>The thing is this xsd file was provided by Microsoft in VSAE package and works fine with Visual Studio but when I'm building it with MSBuild it shows that error.

Please clean the project(right click project -> clean) before you build project.

If the issue still exist, could you please share a simple demo which could reproduce your issue via OneDrive.

Best regards,

Cole Wu

Dziki_Jam on Tue, 07 Feb 2017 09:09:46


Hi, Cole.

First of all, thank you for the reply.

After cleanup msbuild finished the build without any problems on machine with Visual Studio installed.

I wonder, if there's a way to build packs on machine without Visual Studio installed, using only msbuild. As I know, you can't install VSAE on machine without Visual Studio but maybe there's a workaround?

Zhanglong Wu on Thu, 09 Feb 2017 02:27:50


Hi Dziki_Jam,

>>I wonder, if there's a way to build packs on machine without Visual Studio installed, using only msbuild. As I know, you can't install VSAE on machine without Visual Studio but maybe there's a workaround?

Based on your description, you can't install VSAE on machine without Visual Studio, but your project need VSAE when building. So I would suggest that you install VSAE and visual studio on your build machine.

Best regards,

Cole Wu

Dziki_Jam on Thu, 09 Feb 2017 06:46:12


The only solution I've found is to install Visual Studio Evaluation, install VSAE, after that delete Visual Studio. VSAE will remain since Windows Installers mostly are not cleaning their installation files completely and if something was installed to Visual Studio folder not by VS installer it will remain.

Now it works fine though it's definitely not an accurate solution of the problem. But it works.