2

SSAS projects can't be built using MSBuild. However, SSAS projects can reportedly be built using Visual Studio or SSAS Helper (description).

Using the Visual Studio GUI (devenv.exe), the build of my SSAS 2016 Tabular project does indeed build fine:

Build results of a SSAS Tabular 2016 project in Visual Studio

Visual Studio also provides a CLI for non-interactive use: devenv.com . However, although my project builds fine using the GUI, it throws an error when trying to build using the CLI:

devenv.com build throws error "Object reference not set to an instance of an object"

How do I build my SSAS 2016 Tabular projects using the CLI? Does devenv.com use another library for building than devenv.exe?

Background / more information / tries:

The SSAS Helper Sample CLI yields the same error.

The internet doesn't seem to know about this problem..

My smproj file looks as follows:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Development</Configuration>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{8CE414BB-95B2-4C99-9E03-51BA72086E22}</ProjectGuid>
    <OutputType>Exe</OutputType>
    <RootNamespace>MyRootNamespace</RootNamespace>
    <AssemblyName>MyAssemblyName</AssemblyName>
    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
    <OutputPath>bin\</OutputPath>
    <Name>ProjectName_Tabular</Name>
    <DeploymentServerName>devserver</DeploymentServerName>
    <DeploymentServerEdition>Developer</DeploymentServerEdition>
    <DeploymentServerVersion>Version_11_0</DeploymentServerVersion>
    <DeploymentServerDatabase>ProjectName_Tabular</DeploymentServerDatabase>
    <DeploymentServerCubeName>Model</DeploymentServerCubeName>
    <DeploymentOptionProcessing>Default</DeploymentOptionProcessing>
    <DeploymentOptionTransactionalDeployment>False</DeploymentOptionTransactionalDeployment>
    <DeploymentOptionDirectQueryMode>InMemory</DeploymentOptionDirectQueryMode>
    <DeploymentOptionQueryImpersonation>Default</DeploymentOptionQueryImpersonation>
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Development' ">
    <OutputPath>bin\Development\</OutputPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <OutputPath>bin\Release\</OutputPath>
    <DeploymentServerEdition>Enterprise</DeploymentServerEdition>
    <DeploymentOptionProcessing>Full</DeploymentOptionProcessing>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="ProjectName_Tabular.bim">
      <SubType>Code</SubType>
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Compile>
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.targets" />
</Project>
vstrien
  • 2,547
  • 3
  • 27
  • 47

1 Answers1

3

With tabular, you can run msbuild. For example,

msbuild TabularProject8.smproj /verbosity:m /target:Rebuild /property:Configuration=Release

bdog
  • 90
  • 5
  • This is a great workaround! Although `devenv.com` should work like `devenv.exe` IMHO, at least this can help me build my solutions (together with [IntegrationServices.Build.dll for SSIS projects](https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/)) – vstrien Jan 24 '17 at 09:15
  • 2
    I don't have experience with devenv.exe, but the note at the top of this page https://msdn.microsoft.com/en-us/library/xee0c8y7(v=vs.140).aspx says for build-related tasks, it is now recommended that you use MSBuild instead of devenv – bdog Jan 25 '17 at 15:24