VS MSBuild compile error, but project works in SA

jasonjjasonj Posts: 3
edited July 4, 2016 9:52AM in SmartAssembly
I upgraded from SA 6.9 (Pro) to SA 6.10 (Pro) this week. Up until this week all compilations have had no problems. I am encountering an error when I am executing a build from the VS 2013 IDE (Right click project>Build). I can execute the build from the SA program and from commandline without any indication of error.

I get the following error in the 'Error List' Window, which did not happen previously.

Error 2 SmartAssembly build failed:
Failed: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at .‚.( , Int32 )
at ˆ...( , , , )
at ˆ..()
at .‚.( )
at .‚.( , )
at .‚.( )
at ’..() D:VS ProjectsVisual Studio 2013SA runkSA.ServiceSA.Service.csproj 239 5 SA.Service


The SA.Service.csproj file is copied below, i have added a comment tag & red color to make finding the line 239 easier.



<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">;
<Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F3F03357-7716-4EB6-900C-CF0D0C705A53}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SA.Service</RootNamespace>
<AssemblyName>SA.Service</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>binDebug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>binRelease</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>binx86Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>binx86Release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP_Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>binXP_Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP_Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>binx86XP_Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP_Release|AnyCPU'">
<OutputPath>binXP_Release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'XP_Release|x86'">
<OutputPath>binx86XP_Release</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<StartupObject>SA.Service.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..packagesEntityFramework.6.1.3lib
et40EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..packagesEntityFramework.6.1.3lib
et40EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="HSSUSB2_CLR, Version=1.0.4653.27489, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..SA.SensorsDllReferencesHSSUSB2_CLR.dll</HintPath>
</Reference>
<Reference Include="Kepware.ClientAce.BrowseControls">
<HintPath>C:Program Files (x86)Kepware TechnologiesClientAceV4.0Kepware.ClientAce.BrowseControls.dll</HintPath>
</Reference>
<Reference Include="Kepware.ClientAce.DA_Junction">
<HintPath>C:Program Files (x86)Kepware TechnologiesClientAceV4.0Kepware.ClientAce.DA_Junction.dll</HintPath>
</Reference>
<Reference Include="Kepware.ClientAce.KEPServerExControls">
<HintPath>C:Program Files (x86)Kepware TechnologiesClientAceV4.0Kepware.ClientAce.KEPServerExControls.dll</HintPath>
</Reference>
<Reference Include="Kepware.ClientAce.OpcClient, Version=4.0.2.3, Culture=neutral, PublicKeyToken=8c3093bd8fa54956, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:Program Files (x86)Kepware TechnologiesClientAceV4.0Kepware.ClientAce.OpcClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Management" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BehaviorsExceptionLoggingBehavior.cs" />
<Compile Include="DatatypesClientEndpoint.cs" />
<Compile Include="DatatypesNotificationWork.cs" />
<Compile Include="DatatypesSecurityTokenObject.cs" />
<Compile Include="Functions.cs" />
<Compile Include="ImplementationSaCore.cs" />
<Compile Include="ImplementationStreamingService.cs" />
<Compile Include="ProjectInstaller.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="ProjectInstaller.Designer.cs">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</Compile>
<Compile Include="SensorService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="SensorService.Designer.cs">
<DependentUpon>SensorService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="PropertiesAssemblyInfo.cs" />
<Compile Include="ServerSettings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>ServerSettings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
<None Include="packages.config" />
<None Include="ServerSettings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>ServerSettings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ProjectInstaller.resx">
<DependentUpon>ProjectInstaller.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SensorService.resx">
<DependentUpon>SensorService.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..SA.AnalysisSA.Analysis.csproj">
<Project>{0a1afd6b-2443-460d-b6dd-2188b8523850}</Project>
<Name>SA.Analysis</Name>
</ProjectReference>
<ProjectReference Include="..SA.CommonSA.Common.csproj">
<Project>{be25ed63-ac09-4ffe-b95f-74a01221bfab}</Project>
<Name>SA.Common</Name>
</ProjectReference>
<ProjectReference Include="..SA.SensorsSA.Sensors.csproj">
<Project>{21d61d97-e658-41bf-91a5-8ef87b2df8ae}</Project>
<Name>SA.Sensors</Name>
</ProjectReference>
<ProjectReference Include="..SA.UtilitiesSA.Utilities.csproj">
<Project>{8e30c1c2-1bd1-4e10-90c1-ca726a2b3d70}</Project>
<Name>SA.Utilities</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<COMReference Include="ComACRServerLib">
<Guid>{D1F0E094-DF23-4213-93C1-B2D999E9E05B}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<Content Include="Description.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)Microsoft.CSharp.targets" />
<UsingTask TaskName="SmartAssembly.MSBuild.Tasks.Build" AssemblyName="SmartAssembly.MSBuild.Tasks, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7f465a1c156d4d57" />
<Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release' ">
<CallTarget Condition="'$(Configuration)' == 'Release' " Targets="ObfuscateRelease" />
<CallTarget Targets="PostBuild_SignForKep" />
</Target>
<Target Name="PostBuild_SignForKep">
<Message Importance="high" Text="Generating Kepware License File: $(TargetDir)$(TargetName).lic" />
<Exec Command=""C:Program Files (x86)Kepware TechnologiesClientAceSignsign.exe" "$(TargetPath)" "$(TargetDir)$(TargetName).lic"" />
</Target>
<Target Name="ObfuscateRelease">
<CreateItem Include="$(TargetDir)DllReferences*.*">
<Output TaskParameter="Include" ItemName="DllFilesToCopy" />
</CreateItem>
<Message Importance="high" Text="Obfuscating..." />
<MakeDir Directories="$(ProjectDir)..ObfuscationSA.ServiceDllReferences" />
<Copy SourceFiles="@(DllFilesToCopy)"; DestinationFolder="$(ProjectDir)..ObfuscationSA.ServiceDllReferences" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)HSSUSB2_CLR.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)Ionic.Zip.Partial.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)Ionic.Zlib.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)Kepware.ClientAce.BrowseControls.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)Kepware.ClientAce.DA_Junction.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)Kepware.ClientAce.KEPServerExControls.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)Kepware.ClientAce.OpcClient.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)MccDaq.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)SA.Common.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)SA.Utilities.dll" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<Copy SourceFiles="$(TargetDir)SA.Service.exe.config" DestinationFolder="$(ProjectDir)..ObfuscationSA.Service" ContinueOnError="true" />
<SmartAssembly.MSBuild.Tasks.Build ProjectFile="D:VS ProjectsVisual Studio 2013SA runkObfuscationSA.Service.saproj" /> <!-- THIS LINE IS 239, WHERE THE ERROR IS -->
<Message Importance="high" Text="Generating Kepware License File: $(ProjectDir)..ObfuscationSA.Service$(TargetName).lic" />
<Exec Command=""C:Program Files (x86)Kepware TechnologiesClientAceSignsign.exe" "$(ProjectDir)..ObfuscationSA.Service$(TargetFileName)" "$(ProjectDir)..ObfuscationSA.Service$(TargetName).lic"" />
</Target>
<PropertyGroup>
<PostBuildEvent>"C:Program Files (x86)Kepware TechnologiesClientAceSignsign.exe" "$(TargetPath)" "$(TargetName).lic"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Comments

  • To add information, I was able to find the original 6.9 installation and rolled back the install and everything works perfectly again. My question is what has changed in 6.10 that would cause this? To assist with more information Here are my PC / OS specifications.

    Win 7 Professional 64-bit
    16 GB Ram

    Microsoft Visual Studio Professional 2013
    Version 12.0.21005.1 REL
    Microsoft .NET Framework
    Version 4.6.00081

    Installed Version: Professional

    LightSwitch for Visual Studio 2013 06177-179-0078607-02285
    Microsoft LightSwitch for Visual Studio 2013

    Microsoft Office Developer Tools for Visual Studio 2013 ENU 06177-179-0078607-02285
    Microsoft Office Developer Tools for Visual Studio 2013 ENU

    Team Explorer for Visual Studio 2013 06177-179-0078607-02285
    Microsoft Team Explorer for Visual Studio 2013

    Visual Basic 2013 06177-179-0078607-02285
    Microsoft Visual Basic 2013

    Visual C# 2013 06177-179-0078607-02285
    Microsoft Visual C# 2013

    Visual C++ 2013 06177-179-0078607-02285
    Microsoft Visual C++ 2013

    Visual F# 2013 06177-179-0078607-02285
    Microsoft Visual F# 2013

    Visual Studio 2013 Code Analysis Spell Checker 06177-179-0078607-02285
    Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

    Portions of International CorrectSpellâ„¢ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

    The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

    .NET Reflector Visual Studio Extension 8.4.0.39
    Integrates .NET Reflector into Visual Studio to allow you to seamlessly debug into third-party code and assemblies, even if you don't have the source code for them.

    Visit www.reflector.net for more information.

    Copyright (c) 2009-2012 Red Gate Software Inc.

    ANTSVsPackage 1.0
    Start ANTS Performance and Memory Profilers from Visual Studio

    ASP.NET and Web Tools 2013.1.41009
    Microsoft Web Developer Tools contains the following components:
    Support for creating and opening ASP.NET web projects
    Browser Link: A communication channel between Visual Studio and browsers
    Editor extensions for HTML, CSS, and JavaScript
    Page Inspector: Inspection tool for ASP.NET web projects
    Scaffolding: A framework for building and running code generators
    Server Explorer extensions for Windows Azure Web Sites
    Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

    ASP.NET Web Frameworks and Tools 2012.2 4.1.21001.0
    For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

    ASP.NET Web Frameworks and Tools 2013 5.0.11001.0
    For additional information, visit http://www.asp.net/

    Common Azure Tools 1.0
    Provides common services for use by Azure Mobile Services and Windows Azure Tools.

    DevExpress.DeploymentTool 1.0
    A useful tool for deploying DevExpress assemblies.

    InstallShield Limited Edition
    InstallShield. For more information visit the Flexera Software website at <http://www.FlexeraSoftware.com>. Copyright © 2015 Flexera Software LLC. All Rights Reserved.

    NuGet Package Manager 2.7.41101.371
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

    PreEmptive Analytics Visualizer 1.2
    Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

    SQL Server Data Tools 12.0.50902.0
    Microsoft SQL Server Data Tools

    VisualSVN 5.0.1
    Integration with Subversion version control. For more information about VisualSVN, see the VisualSVN website at http://www.visualsvn.com
    Copyright © 2005-2015 VisualSVN Ltd. All rights reserved.

    Windows Azure Mobile Services Tools 1.0
    Windows Azure Mobile Services Tools

    Workflow Manager Tools 1.0 1.0
    This package contains the necessary Visual Studio integration components for Workflow Manager.

    XtraReports package 1.0
    XtraReports package
  • Hi Jason,

    This looks like an issue we identified with the MSBuild process being called by reflection, and so it was launching as 32bit, rather than being called as a new (64 bit) process, which is why you get the Failed: System.IndexOutOfRangeException: Index was outside the bounds of the array error. This is why the build works from within SA, as the SA process launches as 64bit.

    If you are able to run the build using the 64bit version of MSBuild it should work.

    A build to redress this is being worked on currently, I'll give you more information when it becomes available.
    Have you visited our Help Centre?
  • Any news on this?

    The problem I have is that Wix heat requires msbuild to run as x86 and now smart assembly only runs in 64bit - so I'm in a catch-22.
  • Russell DRussell D Posts: 1,143 Diamond 4
    Hi Mika,

    Unfortunately the build never got released, so we currently don't have a working 64bit version.

    If you're able to downgrade to 6.9, the functionality is exactly the same, other than only working in the 32bit address space of course.
    Have you visited our Help Centre?
Sign In or Register to comment.