I am having problems getting my pipeline to succeed.
Obviously the sources are identical (just cloned from master).
The strange thing is when I run the same command using cmd it works.
What is happening ?
I am using .NET 4.6.1
cmd:
C:\Windows\System32>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
"C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" /p:Configuration=Release
[...]
Build succeeded.
0 Warning(s)
0 Error(s)
gitlab CI:
Running with gitlab-runner 11.2.0 (35e8515d)
on .NET BUILDER 67dcb956
Using Shell executor...
Running on <computername>...
Cloning repository...
Cloning into 'C:/temp/GitLabRunner/builds/67dcb956/0/<companyname>/libs'...
Checking out 776042ef as master...
Skipping Git submodules setup
$ & "$env:NUGET_PATH" restore
MSBuild auto-detection: using msbuild version '15.8.166.59604' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'.
Restoring NuGet package Newtonsoft.Json.11.0.2.
Adding package 'Newtonsoft.Json.11.0.2' to folder 'C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\packages'
Added package 'Newtonsoft.Json.11.0.2' to folder 'C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\packages'
NuGet Config files used:
C:\WINDOWS\system32\config\systemprofile\AppData\Roaming\NuGet\NuGet.Config
C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config
Feeds used:
C:\WINDOWS\system32\config\systemprofile\.nuget\packages\
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Installed:
1 package(s) to packages.config projects
$ & "$env:MSBUILD_PATH" /p:Configuration=Release
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 23/08/2018 14:08:49.
Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|Any CPU".
Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" (1) is building "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Tools\Tools.csproj" (2) on node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\Release\".
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
CoreCompile:
C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\mscorlib.dll" /reference:C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Management.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\Tools.dll /subsystemversion:6.00 /target:library /utf8output Attributes\EncryptedElementAttribute.cs Config\ConfigBase.cs Config\ConfigManager.cs Config\IConfig.cs Config\SerializationOption.cs Cryptography\CryptoHelper.cs CustomObjects\EncodingStringWriter.cs ExitCodes.cs ExtensionMethods.cs Globalization\GlobalizationTools.cs http\HttpHelper.cs IO\FileOutputHelper.cs IO\IOHelper.cs Licensing\Base32Converter.cs Licensing\Enrypt.cs Licensing\LicenseManager.cs Logging\ILogFile.cs Logging\LogFile.cs Logging\LogLevel.cs Logging\NotifyingLogFile.cs Networking\NetworkTools.cs Plugins\PluginManager.cs Properties\AssemblyInfo.cs Serialization\CustomXmlSerializer.cs Serialization\JSONSerializer.cs Serialization\XMLSerializer.cs Smtp\SmtpConfig.cs Tools.cs "C:\WINDOWS\TEMP\.NETFramework,Version=v4.6.1.AssemblyAttributes.cs"
ExtensionMethods.cs(109,45): error CS1525: Invalid expression term 'int' [C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Tools\Tools.csproj]
ExtensionMethods.cs(109,49): error CS1003: Syntax error, ',' expected [C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Tools\Tools.csproj]
Done Building Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Tools\Tools.csproj" (default targets) -- FAILED.
Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" (1) is building "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\UITools\UITools.csproj" (3) on node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\Release\".
Done Building Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\UITools\UITools.csproj" (default targets) -- FAILED.
Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" (1) is building "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\DBTools\DBTools.csproj" (4) on node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\Release\".
Done Building Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\DBTools\DBTools.csproj" (default targets) -- FAILED.
Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" (1) is building "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\UIToolsWPF\UIToolsWPF.csproj" (5) on node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\Release\".
Done Building Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\UIToolsWPF\UIToolsWPF.csproj" (default targets) -- FAILED.
Done Building Project "C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" (default targets) -- FAILED.
Build FAILED.
"C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Libs.sln" (default target) (1) ->
"C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Tools\Tools.csproj" (default target) (2) ->
(CoreCompile target) ->
ExtensionMethods.cs(109,45): error CS1525: Invalid expression term 'int' [C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Tools\Tools.csproj]
ExtensionMethods.cs(109,49): error CS1003: Syntax error, ',' expected [C:\temp\GitLabRunner\builds\67dcb956\0\<companyname>\libs\Tools\Tools.csproj]
0 Warning(s)
2 Error(s)
Time Elapsed 00:00:00.92
This is the code that causes failure:
if (int.TryParse(s, out int mins))
{
return TimeSpan.FromMinutes(mins);
}
So thanks to mjwills I checked again my .gitlab-ci.yml.
It turned out I had the following line in it:
MSBUILD_PATH: 'C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe'
Basically I had a mismatch in MSBuild-Versions while logs were sayin I was using Version 15.
Changing it to:
`MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe'`
resolved the issue.
Related
I have a console .netframework ( not .net core) application which I'm trying to build in Azure pipeline. I believe the compliation goes through. But I need help with:
Generating a single file ( if possible )
Publishing the artifact to the artifact directory.
The publishartifact fails with this error:
##[warning]Directory 'D:\a\1\a' is empty. Nothing will be added to build artifact 'TestConsoleOwinSelfHosted'.
I have looked at this but this just copied the entire source directory to the staging directory.
Here is my yaml:
trigger:
- master
stages:
- stage: build
displayName: build solution
variables:
solution: '**/*.sln'
buildPlatform: 'any cpu'
buildConfiguration: 'release'
jobs:
- job: build
displayName: build Job
pool:
name: Azure Pipelines
vmImage: 'windows-latest'
demands:
- msbuild
- visualstudio
- vstest
steps:
- task: NuGetToolInstaller#0
displayName: 'Use NuGet 5.8.0'
inputs:
versionSpec: 5.8.0
- task: NuGetCommand#2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(solution)'
- task: VSBuild#1
displayName: 'Build solution '
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'TestConsoleOwinSelfHosted'
publishLocation: 'Container'
Here is the output of the VSBuild task:
Starting: Build solution
==============================================================================
Task : Visual Studio build
Description : Build with MSBuild and set the Visual Studio version property
Version : 1.187.0
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/visual-studio-build
==============================================================================
"D:\a_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.187.0\ps_modules\MSBuildHelpers\vswhere.exe" -version [16.0,17.0) -latest -format json
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\msbuild.exe" "D:\a\1\s\TestConsoleOwinSelfHosted.sln" /nologo /nr:false /dl:CentralLogger,"D:\a_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.187.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=9378f684-8bb9-4d5e-b61b-d20be97f03a7|SolutionDir=D:\a\1\s"*ForwardingLogger,"D:\a_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.187.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="16.0" /p:_MSDeployUserAgent="VSTS_fa860a9a-7abc-4169-b8fc-d94a1991ceb4_build_1_0"
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 7/7/2021 11:39:39 PM.
Project "D:\a\1\s\TestConsoleOwinSelfHosted.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "release|any cpu".
Project "D:\a\1\s\TestConsoleOwinSelfHosted.sln" (1) is building "D:\a\1\s\TestConsoleOwinSelfHosted\TestConsoleOwinSelfHosted.csproj" (2) on node 1 (default targets).
PrepareForBuild:
Creating directory "bin\Release".
Creating directory "obj\Release".
GenerateBindingRedirects:
No suggested binding redirects from ResolveAssemblyReferences.
CoreCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /fullpaths /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\Microsoft.CSharp.dll" /reference:D:\a\1\s\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll /reference:D:\a\1\s\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.dll /reference:D:\a\1\s\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\mscorlib.dll" /reference:D:\a\1\s\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll /reference:D:\a\1\s\packages\Owin.1.0\lib\net40\Owin.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Net.Http.dll" /reference:D:\a\1\s\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll /reference:D:\a\1\s\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll /reference:D:\a\1\s\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\TestConsoleOwinSelfHosted.exe /subsystemversion:6.00 /target:exe /utf8output /deterministic+ /langversion:7.3 Program.cs Properties\AssemblyInfo.cs Startup.cs ValuesController.cs "obj\Release.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"
CompilerServer: server - server processed compilation - 48a4bca3-f083-4c70-aff0-96988cb31d8d
_CopyFilesMarkedCopyLocal:
Copying file from "D:\a\1\s\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Newtonsoft.Json.dll".
Copying file from "D:\a\1\s\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Microsoft.Owin.dll".
Copying file from "D:\a\1\s\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Microsoft.Owin.Host.HttpListener.dll".
Copying file from "D:\a\1\s\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Microsoft.Owin.Hosting.dll".
Copying file from "D:\a\1\s\packages\Owin.1.0\lib\net40\Owin.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Owin.dll".
Copying file from "D:\a\1\s\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\System.Net.Http.Formatting.dll".
Copying file from "D:\a\1\s\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\System.Web.Http.dll".
Copying file from "D:\a\1\s\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.dll" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\System.Web.Http.Owin.dll".
Copying file from "D:\a\1\s\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.xml" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Microsoft.Owin.xml".
Copying file from "D:\a\1\s\packages\Microsoft.Owin.Host.HttpListener.2.0.2\lib\net45\Microsoft.Owin.Host.HttpListener.xml" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Microsoft.Owin.Host.HttpListener.xml".
Copying file from "D:\a\1\s\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.xml" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Microsoft.Owin.Hosting.xml".
Copying file from "D:\a\1\s\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.xml" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\Newtonsoft.Json.xml".
Copying file from "D:\a\1\s\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.xml" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\System.Net.Http.Formatting.xml".
Copying file from "D:\a\1\s\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.xml" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\System.Web.Http.xml".
Copying file from "D:\a\1\s\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.xml" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\System.Web.Http.Owin.xml".
Creating "D:\a\1\s\TestConsoleOwinSelfHosted\obj\Release\TestConsoleOwinSelfHosted.csproj.CopyComplete" because "AlwaysCreate" was specified.
_CopyAppConfigFile:
Copying file from "D:\a\1\s\TestConsoleOwinSelfHosted\App.config" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\TestConsoleOwinSelfHosted.exe.config".
CopyFilesToOutputDirectory:
Copying file from "D:\a\1\s\TestConsoleOwinSelfHosted\obj\Release\TestConsoleOwinSelfHosted.exe" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\TestConsoleOwinSelfHosted.exe".
TestConsoleOwinSelfHosted -> D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\TestConsoleOwinSelfHosted.exe
Copying file from "D:\a\1\s\TestConsoleOwinSelfHosted\obj\Release\TestConsoleOwinSelfHosted.pdb" to "D:\a\1\s\TestConsoleOwinSelfHosted\bin\Release\TestConsoleOwinSelfHosted.pdb".
Done Building Project "D:\a\1\s\TestConsoleOwinSelfHosted\TestConsoleOwinSelfHosted.csproj" (default targets).
Done Building Project "D:\a\1\s\TestConsoleOwinSelfHosted.sln" (default targets).
I'm trying to build the C# wrappers for RDKit, but have been struggling to make progress. I've attempted two routes:
n.b. This question is long and unhelpful. Long story short use NuGet (see answer below).
Attempt One
Docs from RDKit /Code/JavaWrappers/csharp_wrapper
The first one is found in https://github.com/rdkit/rdkit.
There are C# wrappers with build instructions in ./Code/JavaWrappers/csharp_wrapper found at: https://github.com/rdkit/rdkit/tree/master/Code/JavaWrappers/csharp_wrapper
My first attempt to compile the wrappers involved manually trying to build these. Following this README: https://github.com/rdkit/rdkit/blob/master/Code/JavaWrappers/csharp_wrapper/README
To build on Windows:
Since cmake doesn't know anything about C#, there's an unfortunate
manual step involved in this.
Make sure that the cmake configuration variable
RDK_BUILD_SWIG_CSHARP_WRAPPER is set to ON.
Run cmake to generate the solution file and open it in Visual
Studio.
Select the option to add an existing project and add
$RDBASE/Code/JavaWrappers/csharp_wrapper/RDKit2DotNet.csproj
Right click on the added project (named RDKit2DotNet) and add a
dependency to RDKFuncs (this is the project that creates the C++
dll that the C# project needs)
Build the RDKit2DotNet project.
Your bin directory
($RDBASE/Code/JavaWrappers/csharp_wrapper/bin/Release if you did a
release build) now contains two DLLs:
- RDKFuncs.dll is the C++ dll containing the RDKit functionality
- RDKit2DotNet.dll contains the C# wrapper. To use the wrappers in your own projects, you should copy both dlls into your project
directory and add a reference to RDKit2DotNet.dll
The directory RDKitCSharpTest contains a sample test project and some
code that makes very basic use of the wrapper functionality.
To get cmake to run I updated the CMakeLists.txt to tell it how to find swig and to set RDK_BUILD_SWIG_CSHARP_WRAPPER ON as follows:
cmake_minimum_required(VERSION 3.14)
project (GraphMolCSharp)
set(SWIG_FOUND TRUE) # This has been added
set(SWIG_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # This has been added
set(SWIG_EXECUTABLE swig.exe) # This has been added
set(SWIG_VERSION 4.0) # This has been added
find_package (SWIG) # This has been added
include (UseSWIG) # This has been added
include_directories( ${RDKit_ExternalDir} )
SET(RDK_BUILD_SWIG_CSHARP_WRAPPER ON) # This has been added
# find the gmcs executables on non-windows systems:
if(NOT WIN32)
find_program(GMCS_EXE gmcs)
if (NOT GMCS_EXE)
MESSAGE ("gmcs (executable) is not found. Please add it to PATH and rerun cmake.")
MESSAGE(FATAL_ERROR "Cannot find required executable gmcs")
endif (NOT GMCS_EXE)
endif(NOT WIN32)
SET_SOURCE_FILES_PROPERTIES(GraphMolCSharp.i PROPERTIES CPLUSPLUS ON )
# Setup a few variables for environment-specific things
if(WIN32)
ADD_DEFINITIONS("/W3 /wd4716 /bigobj")
SET(PATH_SEP ";")
SET(COPY_CMD xcopy ${COPY_SOURCE} ${COPY_DEST} /Y /I)
else()
SET(PATH_SEP ":")
SET(COPY_CMD cp -p ${COPY_SOURCE} ${COPY_DEST})
endif()
# Coax SWIG into playing nicely with Apple environments
if(APPLE)
SET(CMAKE_SIZEOF_VOID_P 4)
endif(APPLE)
if(CMAKE_SIZEOF_VOID_P MATCHES 4)
SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap")
else()
if (WIN32)
SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap" "-DSWIGWORDSIZE64" "-DSWIGWIN")
else()
SET(CMAKE_SWIG_FLAGS -namespace "GraphMolWrap" "-DSWIGWORDSIZE64")
endif()
endif()
SET(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_SOURCE_DIR}/swig_csharp )
if(RDK_BUILD_INCHI_SUPPORT)
SET(CMAKE_SWIG_FLAGS "-DRDK_BUILD_INCHI_SUPPORT" ${CMAKE_SWIG_FLAGS} )
endif()
if(RDK_BUILD_AVALON_SUPPORT)
SET(CMAKE_SWIG_FLAGS "-DRDK_BUILD_AVALON_SUPPORT" ${CMAKE_SWIG_FLAGS} )
endif()
FILE(GLOB SWIG_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../*.i")
# we added all source files, now remove the ones that we're not supporting in this build:
if(NOT RDK_BUILD_AVALON_SUPPORT)
LIST(REMOVE_ITEM SWIG_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../AvalonLib.i")
endif()
if(NOT RDK_BUILD_INCHI_SUPPORT)
LIST(REMOVE_ITEM SWIG_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../Inchi.i")
endif()
SET(SWIG_MODULE_RDKFuncs_EXTRA_DEPS ${SWIG_SRC_FILES} )
SWIG_ADD_LIBRARY(RDKFuncs TYPE MODULE LANGUAGE CSharp SOURCES GraphMolCSharp.i )
# it doesnt seem like the threading libs should need to be here, but
# as of Oct 2012 using boost 1.51 under at least ubuntu 12.04 we get a
# link error if they aren't there.
SWIG_LINK_LIBRARIES(RDKFuncs ${RDKit_Wrapper_Libs}
${RDKit_THREAD_LIBS} )
INSTALL(TARGETS RDKFuncs
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR} )
if(NOT WIN32)
# code adapted from the wrapper code for
# GDCM: http://gdcm.svn.sf.net/viewvc/gdcm/trunk/Wrapping/Java/CMakeLists.txt?view=markup
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/RDKit2DotNet.dll
COMMAND ${CMAKE_COMMAND} -E make_directory swig_csharp
## 1. run this custom command only after swig has been run.
COMMAND ${GMCS_EXE} -out:RDKit2DotNet.dll -t:library "swig_csharp/*.cs"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS "${swig_generated_file_fullname}"
)
ADD_CUSTOM_TARGET(RDKFuncsDLL ALL
DEPENDS RDKFuncs ${CMAKE_CURRENT_SOURCE_DIR}/RDKit2DotNet.dll
COMMENT "building mono dll"
)
endif(NOT WIN32)
This creates a lot of new files and one .sln file called GraphMolCSharp.sln.
I was then able to follow the rest of the steps in the README. I opened GraphMolCSharp.sln and added RDKit2DotNet.csproj as a project and added RDKfuncs as a build dependency. But building this gave a lot of errors in Visual Studio, starting with:
Could not copy the file "D:\Desktop\rdkit-master\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was not found. RDKit2DotNet
Then a lot of Unable to find x errors.
If anyone can offer some guidance about anything I might have done wrong please let me know.
Attempt Two
The second uses the build.bat found here: https://github.com/bp-kelley/rdkit-csharp
To start I run:
git clone https://github.com/bp-kelley/rdkit-csharp.git
git clone https://github.com/rdkit/rdkit.git
cd rdkit-csharp
Then I have updated the build.bat to use Visual Studio 16 2019 as follows.
Line 95: cmake -G "Visual Studio 16 2019" -A x64 ...
and
Line 111: cmake -G "Visual Studio 16 2019" ...
If someone is able to offer assistance debugging the output below I'd be most grateful.
I have had to cancel the following line:
Downloading: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe to \Desktop\Build\rdkit-csharp\nuget.exe
^CTerminate batch job (Y/N)? n
But have copied nuget.exe into the expected location.
This is most of the output of running build.bat
**PS D:\Desktop\Build> git clone https://github.com/bp-kelley/rdkit-csharp.git
>> git clone https://github.com/rdkit/rdkit.git
>> cd rdkit-csharp
Cloning into 'rdkit-csharp'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 64 (delta 5), reused 7 (delta 3), pack-reused 52
Unpacking objects: 100% (64/64), done.
Cloning into 'rdkit'...
remote: Enumerating objects: 83, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 61097 (delta 34), reused 38 (delta 22), pack-reused 61014
Receiving objects: 100% (61097/61097), 148.64 MiB | 8.96 MiB/s, done.
Resolving deltas: 100% (46291/46291), done.
Checking out files: 100% (3478/3478), done.
PS D:\Desktop\Build\rdkit-csharp> .\build.bat
///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////
D:\Desktop\Build\rdkit-csharp>call get_nuget https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
Downloading: https://dist.nuget.org/win-x86-commandline/latest/nuget.exe to \Desktop\Build\rdkit-csharp\nuget.exe
^CTerminate batch job (Y/N)? n
Running cmake...
Feeds used:
C:\Users\Sarco\.nuget\packages\
https://api.nuget.org/v3/index.json
C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\
Attempting to gather dependency information for package 'boost-vc140.1.69.0' with respect to project 'D:\Desktop\Build\rdkit-csharp\Nuget.Local', targeting 'Any,Version=v0.0'
///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////
Build started 11/05/2019 09:36:17.
1>Project "D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj" on node 1 (Build target(s)).
1>D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj(32,3): error MSB4019: The imported project "D:\Microsoft
.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the fi
le exists on disk.
1>Done Building Project "D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj" (Build target(s)) -- FAILED.
Build FAILED.
"D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj" (Build target) (1) ->
D:\Desktop\Build\rdkit-csharp\build64\ALL_BUILD.vcxproj(32,3): error MSB4019: The imported project "D:\Microso
ft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the
file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.14
D:\Desktop\Build\rdkit-csharp\build64>copy Code\JavaWrappers\csharp_wrapper\Release\RDKFuncs.dll Code\JavaWrappers\csharp_wrapper
The system cannot find the path specified.
D:\Desktop\Build\rdkit-csharp\build64>copy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj Code\JavaWrappers\csharp_wrapper
1 file(s) copied.
D:\Desktop\Build\rdkit-csharp\build64>robocopy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp Code\JavaWrappers\csharp_wrapper\swig_csharp /E
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : 11 May 2019 09:36:17
Source : D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
Dest : D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\swig_csharp\
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
2019/05/11 09:36:17 ERROR 2 (0x00000002) Accessing Source Directory D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
The system cannot find the file specified.
D:\Desktop\Build\rdkit-csharp\build64>copy D:\Desktop\Build\rdkit-csharp\\RDKit.cs Code\JavaWrappers\csharp_wrapper\swig_csharp\RDKit.cs
The system cannot find the path specified.
0 file(s) copied.
D:\Desktop\Build\rdkit-csharp\build64>msbuild "Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" /m /p:Configuration=Release /maxcpucount:4 /t:Build /p:Platform=AnyCPU
Microsoft (R) Build Engine version 4.7.3056.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 11/05/2019 09:36:18.
1>Project "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" on node 1 (
Build target(s)).
1>PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\Release\".
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect t
o the input files.
CoreCompile:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prom
pt /warn:4 /define:TRACE /highentropyva- /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Fra
mework\.NETFramework\v4.0\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micros
oft\Framework\.NETFramework\v4.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microso
ft\Framework\.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micro
soft\Framework\.NETFramework\v4.0\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Refere
nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /reference:"C:\Program Files (x86)\Refe
rence Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /reference:"C:\Program Files (x86)\Referen
ce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Refere
nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /opti
mize+ /out:obj\Release\RDKit2DotNet.dll /target:library /utf8output
1>CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_
wrapper\RDKit2DotNet.csproj]
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy th
e file "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was not
found. [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]
1>Done Building Project "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.cspro
j" (Build target(s)) -- FAILED.
Build FAILED.
"D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
->
(CoreCompile target) ->
CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\cshar
p_wrapper\RDKit2DotNet.csproj]
"D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
->
(_CopyOutOfDateSourceItemsToOutputDirectoryAlways target) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy
the file "D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was no
t found. [D:\Desktop\Build\rdkit-csharp\build64\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.63
///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found Catch2 source in D:/Desktop/Build/rdkit/External/catch/catch
CATCH: D:/Desktop/Build/rdkit/External/catch/catch/single_include
-- Could NOT find InChI in system locations (missing: INCHI_LIBRARY INCHI_INCLUDE_DIR)
CUSTOM_INCHI_PATH = D:/Desktop/Build/rdkit/External/INCHI-API
-- Found InChI software locally
-- Boost version: 1.69.0
-- Looking for pthread.h
///////// TOO LONG TO POST TO STACKOVERFLOW CUT LINES /////////
in D:/Desktop/Build/rdkit/External/CoordGen/maeparser
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
Unable to find the requested Boost libraries.
Boost version: 1.69.0
Boost include path:
D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include
Could not find the following Boost libraries:
boost_system
boost_iostreams
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
External/CoordGen/CMakeLists.txt:39 (find_package)
-- coordgen include dir set as coordgen_INCLUDE_DIRS-NOTFOUND
-- coordgen libraries set as 'coordgen_LIBRARIES-NOTFOUND'
-- coordgen templates file set as 'coordgen_TEMPLATE_FILE-NOTFOUND'
-- Could NOT find coordgen (missing: coordgen_INCLUDE_DIRS coordgen_LIBRARIES coordgen_TEMPLATE_FILE)
-- Found coordgenlibs source in D:/Desktop/Build/rdkit/External/CoordGen/coordgen
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
Unable to find the requested Boost libraries.
Boost version: 1.69.0
Boost include path:
D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include
Could not find the following Boost libraries:
boost_system
boost_iostreams
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
Code/RDStreams/CMakeLists.txt:4 (find_package)
-- Could NOT find Boost
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
Unable to find the requested Boost libraries.
Boost version: 1.69.0
Boost include path:
D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include
Could not find the following Boost libraries:
boost_system
boost_iostreams
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
Code/GraphMol/FileParsers/CMakeLists.txt:7 (find_package)
-- Could NOT find Boost
== Making EnumerateLibrary without boost Serialization support
== Making FilterCatalog without boost Serialization support
-- Found PythonInterp: D:/Program Files/Python36-32/python.exe (found version "3.6.3")
== Updating Filters.cpp from pains file
== Done updating pains files
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Found Cairo: D:/Desktop/Build/rdkit-csharp/Nuget.Local/cairo.1.12.18.0/build/native/include
== Making SubstructLibrary without boost Serialization support
-- Found RapidJSON source in D:/Desktop/Build/rdkit/External
-- Found SWIG: C:/swig/swig.exe (found version "4.0.0")
CMake Error at D:/Program Files/CMake/share/cmake-3.14/Modules/FindBoost.cmake:2147 (message):
Unable to find the requested Boost libraries.
Boost version: 1.69.0
Boost include path:
D:/Desktop/Build/rdkit-csharp/Nuget.Local/boost.1.69.0.0/lib/native/include
Could not find the following Boost libraries:
boost_system
boost_iostreams
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
Call Stack (most recent call first):
Code/JavaWrappers/CMakeLists.txt:43 (find_package)
-- Could NOT find Boost
SUFFIX:
JAVA_LIBS: AvalonLib;avalon_clib;RDInchiLib;Inchi;RGroupDecomposition;SubstructLibrary;MolStandardize;FilterCatalog;Catalogs;FMCS;MolDraw2D;FileParsers;SmilesParse;Depictor;SubstructMatch;ChemReactions;Fingerprints;ChemTransforms;Subgraphs;GraphMol;DataStructs;Trajectory;Descriptors;PartialCharges;MolTransforms;DistGeomHelpers;DistGeometry;ForceFieldHelpers;ForceField;EigenSolvers;Optimizer;MolAlign;Alignment;SimDivPickers;RDGeometryLib;RDStreams;RDGeneral
CMake Warning (dev) at D:/Program Files/CMake/share/cmake-3.14/Modules/UseSWIG.cmake:600 (message):
Policy CMP0078 is not set: UseSWIG generates standard target names. Run
"cmake --help-policy CMP0078" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
Code/JavaWrappers/csharp_wrapper/CMakeLists.txt:63 (SWIG_ADD_LIBRARY)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at D:/Program Files/CMake/share/cmake-3.14/Modules/UseSWIG.cmake:460 (message):
Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
flag. Run "cmake --help-policy CMP0086" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
D:/Program Files/CMake/share/cmake-3.14/Modules/UseSWIG.cmake:695 (SWIG_ADD_SOURCE_TO_MODULE)
Code/JavaWrappers/csharp_wrapper/CMakeLists.txt:63 (SWIG_ADD_LIBRARY)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "D:/Desktop/Build/rdkit-csharp/build32/CMakeFiles/CMakeOutput.log".
See also "D:/Desktop/Build/rdkit-csharp/build32/CMakeFiles/CMakeError.log".
D:\Desktop\Build\rdkit-csharp\build32>msbuild "ALL_BUILD.vcxproj" /m /p:PlatformTarget=x86 /p:Configuration=Release /maxcpucount:4 /t:Build
Microsoft (R) Build Engine version 4.7.3056.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: ALL_BUILD.vcxproj
D:\Desktop\Build\rdkit-csharp\build32>copy Code\JavaWrappers\csharp_wrapper\Release\RDKFuncs.dll Code\JavaWrappers\csharp_wrapper
The system cannot find the path specified.
D:\Desktop\Build\rdkit-csharp\build32>copy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj Code\JavaWrappers\csharp_wrapper
1 file(s) copied.
D:\Desktop\Build\rdkit-csharp\build32>robocopy ..\..\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp Code\JavaWrappers\csharp_wrapper\swig_csharp /E
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : 11 May 2019 09:36:36
Source : D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
Dest : D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\swig_csharp\
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
2019/05/11 09:36:36 ERROR 2 (0x00000002) Accessing Source Directory D:\Desktop\Build\rdkit\Code\JavaWrappers\csharp_wrapper\swig_csharp\
The system cannot find the file specified.
D:\Desktop\Build\rdkit-csharp\build32>copy D:\Desktop\Build\rdkit-csharp\\RDKit.cs Code\JavaWrappers\csharp_wrapper\swig_csharp\RDKit.cs
The system cannot find the path specified.
0 file(s) copied.
D:\Desktop\Build\rdkit-csharp\build32>msbuild "Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" /m /p:Configuration=Release /maxcpucount:4 /t:Build /p:Platform=AnyCPU
Microsoft (R) Build Engine version 4.7.3056.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 11/05/2019 09:36:36.
1>Project "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" on node 1 (
Build target(s)).
1>PrepareForBuild:
Creating directory "bin\Release\".
Creating directory "obj\Release\".
GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect t
o the input files.
CoreCompile:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prom
pt /warn:4 /define:TRACE /highentropyva- /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Fra
mework\.NETFramework\v4.0\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micros
oft\Framework\.NETFramework\v4.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microso
ft\Framework\.NETFramework\v4.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Micro
soft\Framework\.NETFramework\v4.0\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Refere
nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /reference:"C:\Program Files (x86)\Refe
rence Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /reference:"C:\Program Files (x86)\Referen
ce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Refere
nce Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /opti
mize+ /out:obj\Release\RDKit2DotNet.dll /target:library /utf8output
1>CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_
wrapper\RDKit2DotNet.csproj]
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy th
e file "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was not
found. [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]
1>Done Building Project "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.cspro
j" (Build target(s)) -- FAILED.
Build FAILED.
"D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
->
(CoreCompile target) ->
CSC : warning CS2008: No source files specified [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\cshar
p_wrapper\RDKit2DotNet.csproj]
"D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj" (Build target) (1)
->
(_CopyOutOfDateSourceItemsToOutputDirectoryAlways target) ->
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3713,5): error MSB3030: Could not copy
the file "D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKFuncs.dll" because it was no
t found. [D:\Desktop\Build\rdkit-csharp\build32\Code\JavaWrappers\csharp_wrapper\RDKit2DotNet.csproj]
1 Warning(s)**
Never did manage manually compile the RDKit DotNet Wrapper.
However I did find a NuGet package for an old version that did what I need it to:
https://www.nuget.org/packages/RDKit2DotNet/2017.9.1-alpha1
Install-Package RDKit2DotNet -Version 2017.9.1-alpha1
Update
There is now a newer version which works perfectly:
https://www.nuget.org/packages/RDKit.DotNetWrap/
Install-Package RDKit.DotNetWrap -Version 0.2019033.1
I am getting below error while building jenkins build for a .net project.
C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
As It's trying to find the Visual studio folder on the server which is not present on the server. So is it mandatory to have the visual studio installed on the server?
Below is the complete error log I am getting in jenkins.
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT
C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
C:\Program Files\Git\bin\git.exe config remote.origin.url https://bitbucket.org/pure-nmittal/timesheet/src/master/ # timeout=10
Fetching upstream changes from https://bitbucket.org/pure-nmittal/timesheet/src/master/
C:\Program Files\Git\bin\git.exe --version # timeout=10
using GIT_ASKPASS to set credentials
C:\Program Files\Git\bin\git.exe fetch --tags --progress https://bitbucket.org/pure-nmittal/timesheet/src/master/ +refs/heads/*:refs/remotes/origin/*
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 25e45ba269d04cb48a4d17090e391df08f73bedf (refs/remotes/origin/master)
C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
C:\Program Files\Git\bin\git.exe checkout -f 25e45ba269d04cb48a4d17090e391df08f73bedf
Commit message: "profile"
C:\Program Files\Git\bin\git.exe rev-list --no-walk 25e45ba269d04cb48a4d17090e391df08f73bedf # timeout=10
[Timesheet_UAT] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Windows\TEMP\jenkins2437051443515371203.ps1'"
--Restoring Nuget packages BEGIN--
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin\amd64'.
All packages listed in packages.config are already installed.
--Restoring Nuget packages END--
Path To MSBuild.exe: C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe
Executing the command cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /p:DeployOnBuild=true /p:PublishProfile=UAT "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" " && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT
[Timesheet_UAT] $ cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /p:DeployOnBuild=true /p:PublishProfile=UAT "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 14.0.23107.0
Copyright (C) Microsoft Corporation. All rights reserved.
-
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 11/27/2018 1:30:20 AM.
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (1) is building "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (2) on node 1 (default targets).
C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default targets) -- FAILED.
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (1) is building "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (3) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1097,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj]
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (3) is building "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (2:2) on node 1 (default targets).
C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default targets) -- FAILED.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (default targets) -- FAILED.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default targets) -- FAILED.
Build FAILED.
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default target) (1) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (default target) (3) ->
(GetReferenceAssemblyPaths target) ->
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1097,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj]
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default target) (1) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default target) (2) ->
C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default target) (1) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (default target) (3) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default target) (2:2) ->
C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
1 Warning(s)
2 Error(s)
Time Elapsed 00:00:00.21
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE
I have Service Fabric based system created and working on production environment (and development). Everything is ok. Now I was trying to setup CI on Visual Studio Team Services with provided templates for ASF projects.
Unfortunately my system has Actors (.NET 4.5.2) and WebAPI based on ASP.NET Core 1.1. I have references to Actor interfaces project (also .NET 4.5.2) forom .NET Core.
When I'm trying to build project with default template I'm recieving error because dotnet restore was not run. Ok, so I've added step to run dotnet restore but then I'm getting error complaining that it cannot find reference to Actor.Interfaces.
dotnet restore also fails on my dev machine but solution build with VS goes ok.
How can I fix this issue?
[UPDATE]
Thanks Mardoxx, I've made some progress... now I'm getting below error for *.sln buld. My solution is VS2015 (set in build task), I've set env to Hosted VS2017.
IntegrationApi\IntegrationApi.xproj(7,11): Error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\DotNet\Microsoft.DotNet.Props" was not found. Also, tried to find "DotNet\Microsoft.DotNet.Props" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Project "d:\a\1\s\Labelcall.sln" (1) is building "d:\a\1\s\IntegrationApi\IntegrationApi.xproj" (18) on node 1 (default targets).
d:\a\1\s\IntegrationApi\IntegrationApi.xproj(7,11): error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\DotNet\Microsoft.DotNet.Props" was not found. Also, tried to find "DotNet\Microsoft.DotNet.Props" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\amd64\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
Done Building Project "d:\a\1\s\IntegrationApi\IntegrationApi.xproj" (default targets) -- FAILED.
[UPDATE2]
After taking steps presented by starain-MSFT I'm getting errors during 'dotnet restore':
log : Restoring packages for d:\a\1\s\AdminPanel\project.json...
error: Unable to resolve 'AccountActor.Interfaces' for
'.NETFramework,Version=v4.5.2'.
error: Unable to resolve 'CommonContracts' for
'.NETFramework,Version=v4.5.2'.
error: Unable to resolve 'CommonInfrastructure' for
'.NETFramework,Version=v4.5.2'.
[UPDATE3]
Another update after #starain input.
Now I'm getting error that references (to .NET 4.5.2 projcects from Core projects) could not be found.
Project "d:\a\1\s\LabelcallApplication\LabelcallApplication.sfproj" (2) is building "d:\a\1\s\MobileApi\MobileApi.xproj" (19) on node 1 (default targets).
PrepareForBuild:
Creating directory ".\bin\".
Creating directory ".\obj\Release\".
PreComputeCompileTypeScript:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.0\tsc.exe --noEmitOnError --listEmittedFiles
CompileTypeScript:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\2.0\tsc.exe --noEmitOnError --listEmittedFiles
CoreCompile:
C:\Program Files\dotnet\dotnet.exe build "d:\a\1\s\MobileApi" --configuration Release --no-dependencies
Project MobileApi (.NETFramework,Version=v4.5.2) will be compiled because expected outputs are missing
Compiling MobileApi for .NETFramework,Version=v4.5.2
C:\Program Files\dotnet\dotnet.exe compile-csc #d:\a\1\s\MobileApi\obj\Release\net452\dotnet-compile.rsp returned Exit Code 1
MobileApi\project.json(6,44): Warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.DependencyCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0
d:\a\1\s\MobileApi\project.json(6,44): warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.DependencyCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0 [d:\a\1\s\MobileApi\MobileApi.xproj]
MobileApi\project.json(6,44): Warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.PerfCounterCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0
d:\a\1\s\MobileApi\project.json(6,44): warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.PerfCounterCollector 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0 [d:\a\1\s\MobileApi\MobileApi.xproj]
MobileApi\project.json(6,44): Warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0
d:\a\1\s\MobileApi\project.json(6,44): warning NU1012: Dependency conflict. Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel 2.2.0 expected Microsoft.ApplicationInsights 2.2.0 but received 2.3.0 [d:\a\1\s\MobileApi\MobileApi.xproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): Error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\ContactActor.Interfaces\bin\Release\ContactActor.Interfaces.dll' could not be found
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\ContactActor.Interfaces\bin\Release\ContactActor.Interfaces.dll' could not be found [d:\a\1\s\MobileApi\MobileApi.xproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): Error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\DeviceActor.Interfaces\bin\Release\DeviceActor.Interfaces.dll' could not be found
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : d:\a\1\s\MobileApi\error CS0006: Metadata file 'd:\a\1\s\DeviceActor.Interfaces\bin\Release\DeviceActor.Interfaces.dll' could not be found [d:\a\1\s\MobileApi\MobileApi.xproj]
Compilation failed.
3 Warning(s)
2 Error(s)
Time elapsed 00:00:01.7675632
Refer to these steps below:
Create a new build definition with Azure Service Fabric Application template
Change Visual Studio Version to Visual Studio 2015 for Visual Studio Build steps.
Select NuGet Installer step/task, change NuGet version to 3.5.0 in Advanced section.
Select Options tab and change Default agent queue to Hosted
Queue build with Hosted agent. (Not Hosted VS 2017)
All build steps:
NuGet Installer (NuGet restore ***.sln)
.Net Core (dotnet restore)
Visual Studio Build (Build solution ***.sln)
Visual Studio Build (Build solution ***.sfproj)
Copy Files
Delete files
Update Service Fabric App Versions
Copy Files
Publish Build Artifacts
I am trying to build a Visual Studio Package from the command line and running into problems.
The project builds perfectly inside the Visual Studio environment, both release and debug. I am just trying to get the project to build through command line as well. Other projects, not Visual Studio Package projects, build fine. The problem is the introduction of the VSSDK.
Error:
12:33:41.147 2>C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(107,5): error VSSDK1000: Failed to load 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' Assembly. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format. [C:\VsProjects\MyProject\MyProject.csproj]
Done executing task "VSCTCompiler" -- FAILED. (TaskId:24)
12:33:41.147 2>Done building target "VSCTCompile" in project "MyProject.csproj" -- FAILED.: (TargetId:42)
12:33:41.147 2>Target "_CheckForCompileOutputs: (TargetId:43)" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\VsProjects\MyProject\MyProject.csproj" (target "_CleanGetCurrentAndPriorFileWrites" depends on it):
I did see these articles, the first of which helped the most and got me past the previous error and onto this error:
MS Build with VS2012 Package Project
MS Build command line...VSSDK
Build a VS Package in Team Environment
I set the VSSDKInstall path to:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK
My system: Windows 8.1 Pro X64
Build: Any CPU
I do realize that the project builds in 32-bit environment from what I have read.
I did implement:
Set VSSDKInstall environment variable and restart
Execute: call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\vsvars32.bat"
Do the ms build call
I ran the diagnostic build and here is a larger fragment:
12:33:41.132 2>Done building target "PrepareRdlFiles" in project "MyProject.csproj".: (TargetId:39)
Target "RunRdlCompiler" skipped, due to false condition; ('#(RdlFile)'!='') was evaluated as (''!='').
12:33:41.133 2>Target "CompileRdlFiles: (TargetId:40)" in file "C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\ReportingServices\Microsoft.ReportingServices.targets" from project "C:\VsProjects\MyProject\MyProject.csproj" (target "PrepareResources" depends on it):
12:33:41.133 2>Done building target "CompileRdlFiles" in project "MyProject.csproj".: (TargetId:40)
12:33:41.133 2>Target "GenerateListOfCTO: (TargetId:41)" in file "C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.targets" from project "C:\VsProjects\MyProject\MyProject.csproj" (target "MergeCtoResource" depends on it):
Task "AssignCulture" (TaskId:23)
Task Parameter:
Files=
obj\Debug\MyProject.cto
ResourceName=Menus.ctmenu (TaskId:23)
Culture of "" was assigned to file "obj\Debug\MyProject.cto". (TaskId:23)
Done executing task "AssignCulture". (TaskId:23)
12:33:41.133 2>Done building target "GenerateListOfCTO" in project "MyProject.csproj".: (TargetId:41)
Target "FindSDKInstallation" skipped, due to false condition; ('$(VsSDKInstall)'=='') was evaluated as ('C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK'=='').
12:33:41.133 2>Target "VSCTCompile: (TargetId:42)" in file "C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets" from project "C:\VsProjects\MyProject\MyProject.csproj" (target "MergeCtoResource" depends on it):
Using "VSCTCompiler" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Build.Tasks.dll".
Task "VSCTCompiler" (TaskId:24)
Task Parameter:IntermediateDirectory=obj\Debug\ (TaskId:24)
Task Parameter:
Definitions=
__CTC__
_CTC_GUIDS_ (TaskId:24)
Task Parameter:NoLogo=True (TaskId:24)
Task Parameter:OutputFile=MyProject.cto (TaskId:24)
Task Parameter:Source=MyProject.vsct (TaskId:24)
Task Parameter:Verbose=False (TaskId:24)
Task Parameter:SDKVersion=12.0 (TaskId:24)
12:33:41.147 2>C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(107,5): error VSSDK1000: Failed to load 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' Assembly. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format. [C:\VsProjects\MyProject\MyProject.csproj]
Done executing task "VSCTCompiler" -- FAILED. (TaskId:24)
12:33:41.147 2>Done building target "VSCTCompile" in project "MyProject.csproj" -- FAILED.: (TargetId:42)
12:33:41.147 2>Target "_CheckForCompileOutputs: (TargetId:43)" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\VsProjects\MyProject\MyProject.csproj" (target "_CleanGetCurrentAndPriorFileWrites" depends on it):
12:33:41.148 2>Done building target "_CheckForCompileOutputs" in project "MyProject.csproj".: (TargetId:43)
Target "_SGenCheckForOutputs" skipped, due to false condition; ('$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('#(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')) was evaluated as ('Off' == 'On' or (''!='' and 'Off' == 'Auto')).
12:33:41.148 2>Target "_CleanGetCurrentAndPriorFileWrites: (TargetId:44)" in file "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets" from project "C:\VsProjects\MyProject\MyProject.csproj" (target "_CleanRecordFileWrites" depends on it):
Here is the normal output:
1/4/2015 1:10:05 PM: Building project step 11 - Build: Debug (Any CPU)...
Pre-processing...
Building configuration 'Debug|Any CPU'...
Microsoft (R) Build Engine version 12.0.31101.0
[Microsoft .NET Framework, version 4.0.30319.34014]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 1/4/2015 1:10:06 PM.
1>Project "C:\VsProjects\MyProject.sln" on node 1 (default targets).
1>ValidateSolutionConfiguration:
Building solution configuration "Debug|Any CPU".
1>Project "C:\VsProjects\MyProject.sln" (1) is building "C:\VsProjects\MyProject\MyProject.csproj" (2) on node 1 (default targets).
2>MainResourcesGeneration:
Skipping target "MainResourcesGeneration" because all output files are up-to-date with respect to the input files.
CoreResGen:
No resources are out of date with respect to their source files. Skipping resource generation.
2>C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(107,5): error VSSDK1000: Failed to load 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' Assembly. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format. [C:\VsProjects\MyProject\MyProject.csproj]
2>Done Building Project "C:\VsProjects\MyProject\MyProject.csproj" (default targets) -- FAILED.
1>Done Building Project "C:\VsProjects\MyProject.sln" (default targets) -- FAILED.
Build FAILED.
"C:\VsProjects\MyProject.sln" (default target) (1) ->
"C:\VsProjects\MyProject\MyProject.csproj" (default target) (2) ->
(VSCTCompile target) ->
C:\Program Files (x86)\MSBuild\Microsoft VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(107,5): error VSSDK1000: Failed to load 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' Assembly. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 12.0\VSSDK\VisualStudioIntegration\Tools\bin\VSCT.exe' or one of its dependencies. An attempt was made to load a program with an incorrect format. [C:\VsProjects\MyProject\MyProject.csproj]
UPDATE:
The problem might be what I set the VSSDKInstall environment variable to, because I tried to build the project inside VS and failed, both in debug and release. I was forced to remove the environment variable and restart the computer.
UPDATE: January 29, 2015
Full path is:
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\msbuild.exe
I use a build utility, which calls a script.
Here is an excerpt from the diagnostic msbuild. I cut out extraneous things.
Building configuration 'Debug|Any CPU'...
Microsoft (R) Build Engine version 12.0.31101.0
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\msbuild.exe /maxcpucount:1 /p:Platform=Any CPU /v:diagnostic <path to project>\myproject.sln
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 1/29/2015 8:04:26 AM.
Environment at start of build:
ALLUSERSPROFILE = C:\ProgramData
ANT_HOME = C:\SoftDev\Tools\Java\Ant\apache-ant-1.9.3
APPDATA = C:\Users\sarahmarci.JMR\AppData\Roaming
ArmServerInfo = 02272370
asl.log = Destination=file
Done building target "ResGen" in project "myproject.csproj".: (TargetId:37)
Target "CompileLicxFiles" skipped, due to false condition; ('#(_LicxFile)'!='') was evaluated as (''!='').
Target "PrepareRdlFiles: (TargetId:38)" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\ReportingServices\Microsoft.ReportingServices.targets" from project "<path to project>\<my project>\myproject.csproj" (target "CompileRdlFiles" depends on it):
Task "CreateItem" skipped, due to false condition; ('%(Extension)'=='.rdlc') was evaluated as ('.resx'=='.rdlc').
Task "CreateItem" skipped, due to false condition; ('%(Extension)'=='.rdlc') was evaluated as ('.ico'=='.rdlc').
Task "CreateItem" skipped, due to false condition; ('%(Extension)'=='.rdlc') was evaluated as ('.png'=='.rdlc').
Task "CreateItem" skipped, due to false condition; ('%(Extension)'=='.rdlc') was evaluated as ('.rtf'=='.rdlc').
Task "CreateItem" skipped, due to false condition; ('%(Extension)'=='.rdlc') was evaluated as ('.docx'=='.rdlc').
Task "CreateItem" skipped, due to false condition; ('%(Extension)'=='.rdlc') was evaluated as ('.txt'=='.rdlc').
Done building target "PrepareRdlFiles" in project "myproject.csproj".: (TargetId:38)
Target "RunRdlCompiler" skipped, due to false condition; ('#(RdlFile)'!='') was evaluated as (''!='').
Target "CompileRdlFiles: (TargetId:39)" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\ReportingServices\Microsoft.ReportingServices.targets" from project "<path to project>\<my project>\myproject.csproj" (target "PrepareResources" depends on it):
Done building target "CompileRdlFiles" in project "myproject.csproj".: (TargetId:39)
Target "GenerateListOfCTO: (TargetId:40)" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.targets" from project "<path to project>\<my project>\myproject.csproj" (target "MergeCtoResource" depends on it):
Task "AssignCulture" (TaskId:22)
Task Parameter:
Files=
obj\Debug\myproject.cto
ResourceName=Menus.ctmenu (TaskId:22)
Culture of "" was assigned to file "obj\Debug\myproject.cto". (TaskId:22)
Done executing task "AssignCulture". (TaskId:22)
Done building target "GenerateListOfCTO" in project "myproject.csproj".: (TargetId:40)
Target "FindSDKInstallation: (TargetId:41)" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets" from project "<path to project>\<my project>\myproject.csproj" (target "VSCTCompile" depends on it):
Using "FindVsSDKInstallation" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Build.Tasks.dll".
Task "FindVsSDKInstallation" (TaskId:23)
Task Parameter:SDKVersion=12.0 (TaskId:23)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(74,5): error VSSDK1036: Can not find the installation for VS SDK. [<path to project>\<my project>\myproject.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(76,7): error MSB4018: The "FindVsSDKInstallation" task failed unexpectedly. [<path to project>\<my project>\myproject.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(76,7): error MSB4018: System.ArgumentNullException: Value cannot be null. [<path to project>\<my project>\myproject.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(76,7): error MSB4018: Parameter name: path1 [<path to project>\<my project>\myproject.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(76,7): error MSB4018: at System.IO.Path.Combine(String path1, String path2) [<path to project>\<my project>\myproject.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(76,7): error MSB4028: The "FindVsSDKInstallation" task's outputs could not be retrieved from the "IncludesPath" parameter. Value cannot be null. [<path to project>\<my project>\myproject.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.Common.targets(76,7): error MSB4028: Parameter name: path1 [<path to project>\<my project>\myproject.csproj]
Done executing task "FindVsSDKInstallation" -- FAILED. (TaskId:23)
Thoughts?
I had faced similar problem and here's how I solved it.
Few facts before that:
1) VSCT.exe is a 32-bit exe. That's the only version which is shipped. You can confirm that by locating the exe listed in the error message and running "dumpbin /headers vsct.exe" and see that it's a x86 (or 32-bit) binary.
2) A 64-bit exe/dll cannot load a 32-bit binary. And if tried gives this "incorrect format" exception which you are seeing in your exception details.
3) MSBuild.exe ships as both 64-bit and 32-bit binaries.
Answer:
This error will happen if you use 64-bit MSBuild.exe to compile any project containing VSCTCompile target. The reason is VSCT.exe is a 32-bit exe and you are trying to call that from 64-bit msbuild.exe.
Fix:
To fix this, you should either explicitly use 32-bit msbuild.exe or open a 32-bit command line. Here's how you do that: http://www.tipandtrick.net/how-to-open-and-run-32-bit-command-prompt-in-64-bit-x64-windows/
If you run msbuild from 32-bit command line window then your build should succeed.