TFS 2017, build failing because of ssrs project into the solution - tfs

I am creating build for solution which has 2 projects (ssis,ssrs and SSAS) i am getting below error. I think this is because of SSRS in the solution. I have taken VS build and passed MSBuild arguremnts: /ignore:.dtproj,.rptproj
Error messages:
Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68):Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68,11): Error MSB4226: The imported project "O:\Microsoft Visual Studio\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" was not found. Also, tried to find "Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "O:\Microsoft Visual Studio\MSBuild\15.0\Bin\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.
Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3):Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3,3): Error MSB4067: The element <DeploymentModel> beneath element <Project> is unrecognized.
Process 'msbuild.exe' exited with code '1'.
Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3):Source\Main\BI\Advocaten.BI\SSIS Advocaten\SSIS Advocaten.dtproj(3,3): Error MSB4067: The element <DeploymentModel> beneath element <Project> is unrecognized.
C:\Program Files (x86)\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.targets(71):C:\Program Files (x86)\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.targets(71,7): Error MSB4062: The "Microsoft.AnalysisServices.VSHostBuilder.SemanticModelGetOutputFilesTask" task could not be loaded from the assembly O:\Microsoft Visual Studio\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.dll. Could not load file or assembly 'file:///O:\Microsoft Visual Studio\MSBuild\Business Intelligence Semantic Model\1.0\Microsoft.AnalysisServices.VSHostBuilder.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68):Source\Main\BI\Advocaten.BI\SSRS Advocaten\SSRS Advocaten.rptproj(68,11): Error MSB4226: The imported project "O:\Microsoft Visual Studio\MSBuild\Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" was not found. Also, tried to find "Reporting Services\Microsoft.ReportingServices.MSBuilder.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "O:\Microsoft Visual Studio\MSBuild\15.0\Bin\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.
Process 'msbuild.exe' exited with code '1'.

Related

BDD with Specflow in Visual Studio 2017 -featurefile Error CS1029

I am trying out BDD with Specflow in Visual Studio 2017. Previously I had created a new project and added Specflow and Nunit using NuGet Package Manager. From the Solution Explorer, I right click and select Add New Item. From the Add New Item window, I could see SpecFlow feature File and Feature.cs file
But I open the Feature.cs it's showing empty with the message
<#error Generation error: The element may only appear once in this section.>
Then I try to build the solution then I'm getting error on Output
Error CS1029
error: 'Generation error: The element may only appear once in this section.'
The references I can see from Solution Explorer are: SpecRun.SpecFlowPlugin TechTalk.SpecFlow TechTalk.SpecRun NUnit.VisualStudio.TestAdapter
Am I missing something?
Thanks, Mohammed
If you have a scenario outline, but you for get to write the Examples-Keyword, you will get the following error during the build process:
CS1029 #error: 'Generation error: Sequence contains no elements' in Line 1 of MyFeature.feature
It took me some hours in my large created feature file to locate my error. I deleted the temp files, restarted visual studio several times, but it was difficult to figure out why it occurs.
Could you somehow improve the error messages e.g. with a better location, a simple syntax check before or something similar?
As far as I understand, the ScenarioOutline, followed by a will allways need at least an Examples keyword and a table with this varname, before an other Tag like Scenario, etc. is allowed again. I would appreciate to have such markup
?xml version="1.0" encoding="utf-8"?>
configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
</configSections>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><unitTestProvider name="SpecRun" /><plugins>
<add name="SpecRun" />
</plugins></specFlow>
</configuration>

ServiceStack F# sample fails starting

I'm trying to run this Self Hosting example, using latest ServiceStack release (4.0.3) and latest Mono/F# (3.2.5).
It fails with an exception on appHost.Init():
{ System.IO.FileNotFoundException: Virtual file not found File name: '<>.FSharpSignatureData.'
at ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualFile (System.String resourceName) [0x00033] in <>/ServiceStack/VirtualPath/ResourceVirtualDirectory.cs:99 } System.IO.FileNotFoundException
The same does not happen with the C# sample.
Apparently, it looks for some files added as resources in F# assemblies but not mapped to a physical file.
F# does some 'meta data caching' that puts resources (FSharpSignatureData, FSharpOptimizationData) into the assembly. This causes issues when ServiceStack sets up its virtual file system since it wants to map these resources to actual files (I think).
You can get past this by adding the flag --nointerfacedata to the build/compile steps. (in VS Properties > Build > 'Other flags')
I've been meaning to post this to the GitHub issues page.

Compiling jabber-net in Xamarin Studio

I am trying to compile jabber-net in Xamarin Studio so I can use it in a Xamarin.iOS app.
From other searches I have done I am told I need to recompile the source.
From command line I can build the dll, but I have no idea what version of .NET/Mono this is targeting.
This makes a jabber-net.dll and a jabber-net.dll.mdb.
If I add jabber-net.dll to my project, add the reqiured
using jabber.client;
...
...
...
JabberClient client = new JabberClient ();
and try to compile I am told.
/Users/brad/Projects/XMPPChat/XMPPChat/AppDelegate.cs(37,47): error CS0584: Internal compiler error: Could not import type jabber.client.JabberClient' fromjabber-net, Version=2.1.0.702, Culture=neutral, PublicKeyToken=924c5b18328d6f09'
/Users/brad/Projects/XMPPChat/XMPPChat/AppDelegate.cs(37,38): error CS0584: Internal compiler error: Could not import type jabber.client.JabberClient' fromjabber-net, Version=2.1.0.702, Culture=neutral, PublicKeyToken=924c5b18328d6f09'
/Users/brad/Projects/XMPPChat/XMPPChat/AppDelegate.cs(37,38): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
I got no idea what is going on here...
When I try to open any of the .sln's (or include any of the existing projects, even the mono specific project) that came with jabber-net into my solution it will either hang trying to convert the project, or will tell me
The file '/Users/brad/Projects/XMPPChat/JabberNet-2.1.0.710/mono-jabber-net.csproj' could not be loaded.
and will spit out this error.
Any idea where to go from here? :|
Start a new solution from scratch, and add all of the .cs files except those in the test and examples directories. Also make sure you don't have an old version of the .dll around somewhere.

Getting Migrate.exe to work

I have been struggling on executing EF Migrate.exe to work.
My Solution has couple of projects. The migrations and the entities live in the project Data. The controllers and views live in Web.
I tried using the migrate.exe - however I am struggling getting the first argument (assembly) to be accepted. Documentations says:
Assembly: Specifies the name of the assembly that contains the
migrations configuration type.
I have tried:
migrate.exe "MySolution\DataProject\bin\Debug\Data.dll"
ERROR: Could not load file or assembly 'D:\\MySolution\\Data\\bin\\Debug\\Data' or one of its dep
endencies. The given assembly name or codebase was invalid. (Exception from HRES
ULT: 0x80131047)
Any idea what is going wrong?
After reading this, this, and this
I have (I think) what you need :
If you use migrate.exe against a .NET 4 assembly you NEED to rename the Redirect.config available in packages\EntityFramework.5.0.0\tools to migrate.exe.config and copy this to the SAME directory as migrate.exe. For running migrate.exe against a .NET 4.5 assembly you DO NOT NEED this copy, the migrate.exe.config must not exist.
The correct version of entity framework DLL must be in the SAME directory as migrate.exe. Correct version is packages\EntityFramework.5.0.0\lib\net40\ for running migrate.exe against a .NET 4 assembly. Correct version is packages\EntityFramework.5.0.0\lib\net45\ for running migrate.exe against a .NET 4.5 assembly
If you specify /StartUpDirectory= do not specify the path for /assembly example : C:\Tools\migrate.exe some.dll /StartUpDirectory=C:\Project\bin\.
If you don't specify a startup directory, then you need to specify the full path in the /assembly example : C:\Tools\migrate.exe C:\Project\bin\some.dll - In this scenario migrate.exe will not be able to load the some.dll's dependencies, unless you put all some.dll's dependencies and put it in the SAME directory as migrate.exe.
If you put the migrate.exe in the same path as your some.dll, then migrate.exe will be able to use the same EntityFramework.dll which your app uses, and can load all dependencies, and can load the some.dll without any path like C:\Tools\migrate.exe some.dll
If you put the migrate.exe in a separate tools folder like Im doing it needs the correct version of the EntityFramework.dll in the SAME directory as migrate.exe, it will need the /StartUpDirectory=<the path where you target dll is present> clause, and you should specify the name of the assembly without the path like : C:\Tools\migrate.exe some.dll /StartUpDirectory=C:\Project\bin\
Heres the powershell commmand I use :
$SolutionPath = (Resolve-Path '..').Path
$ToolsPath = "$SolutionPath\Build\Lib\"
task db {
$migrator = $ToolsPath + 'Migrations\migrate.exe'
$migrateCommand = "$migrator zasz_me.dll /StartUpDirectory=$SolutionPath\zasz.me\bin\ /connectionStringName:FullContext /startUpConfigurationFile:$SolutionPath\zasz.me\Web.config /verbose"
Write-Host $migrateCommand
Invoke-Expression $migrateCommand
}
I answered a similar question here on how to override connectionstring through parameters to migrate.exe. I have yet to get it working without specifying a web/app.config file.
https://stackoverflow.com/a/14138797/134761

Troubleshooting MSBuild failures

I am trying to convert my shop from using VSS to TFS.
Our current codebase consists of a large number of Visual Studio 2008 solutions and I've noticed some of them seem to cause MSBuild to fail, but I cannot figure out why. The actual solutions themselves and the projects they hold build correctly, but the overall build still fails.
The ErrorsAndWarnings.txt and Release.txt file show no errors, just warnings (various little things in the code we need to clean up)
The BuildLog.txt file is, of course, enormous and has tons and tons of difficult-to-comprehend text in it. As best I can tell though, when it gets to one of these SLN files that give it problems, MSBuild just flat out crashes and dies.
Task "MSBuild"
Global Properties:
Configuration=Release
Platform=Any CPU
OutDir=C:\TFS\REPOSITORY\Full\Binaries\Release\
PublishDir=C:\TFS\REPOSITORY\Full\Binaries\Release\
SkipInvalidConfigurations=true
RunCodeAnalysis=false
VCBuildOverride=C:\TFS\REPOSITORY\Full\Sources\Code\Solution\Solution.sln.Release.vsprops
VCBuildAdditionalLibPaths=
VCBuildAdditionalOptions=
VCBuildToolPath=
VCBuildUseEnvironment=
TeamBuildConstants=_TEAM_BUILD_
TargetsNotLogged=GetTargetPath;GetNativeManifest;GetCopyToOutputDirectoryItems
C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets(1008,5):
error MSB4018: The "MSBuild" task failed unexpectedly.
error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevel(ProjectInSolution project, SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevel(ProjectInSolution project, SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.AssignDependencyLevels(SolutionParser solution, Dictionary`2 projectsByDependencyLevel)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.CreateSolutionProject(SolutionParser solution, Project msbuildProject, BuildEventContext projectBuildEventContext, String wrapperProjectToolsVersion, Engine parentEngine, String solutionProjectCache)
error MSB4018: at Microsoft.Build.BuildEngine.SolutionWrapperProject.Generate(SolutionParser solution, Project msbuildProject, String toolsVersionOverride, BuildEventContext projectBuildEventContext)
error MSB4018: at Microsoft.Build.BuildEngine.Project.Load(String projectFileName, BuildEventContext buildEventContext, ProjectLoadSettings projectLoadSettings)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.GetMatchingProject(Project existingProject, String projectFullPath, BuildPropertyGroup globalPropertiesToUse, String toolsVersion, String[] targetNames, BuildEventContext buildEventContext, Boolean toolsVersionPeekedFromProjectFile)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.BuildProjectFileInternal(BuildRequest buildRequest)
error MSB4018: at Microsoft.Build.BuildEngine.Engine.EngineBuildLoop(BuildRequest terminatingBuildRequest)
error MSB4018: at Microsoft.Build.BuildEngine.TaskExecutionModule.BuildProjectFile(Int32 handleId, String[] projectFileNames, String[] targetNames, IDictionary[] globalPropertiesPerProject, IDictionary[] targetOutputsPerProject, EngineLoggingServices loggingServices, String[] toolsVersions, Boolean useResultsCache, Boolean unloadProjectsOnCompletion, BuildEventContext taskContext)
error MSB4018: at Microsoft.Build.BuildEngine.EngineProxy.BuildProjectFilesInParallel(String[] projectFileNames, String[] targetNames, IDictionary[] globalProperties, IDictionary[] targetOutputsPerProject, String[] toolsVersions, Boolean useResultsCache, Boolean unloadProjectsOnCompletion)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.ExecuteTargets(ITaskItem[] projects, Hashtable propertiesTable, ArrayList targetLists, Boolean stopOnFirstFailure, Boolean rebaseOutputs, IBuildEngine2 buildEngine, TaskLoggingHelper log, ArrayList targetOutputs, Boolean useResultsCache, Boolean unloadProjectsOnCompletion, String toolsVersion)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.BuildProjectsInParallel(Hashtable propertiesTable, ArrayList targetLists, Boolean success, Boolean[] skipProjects)
error MSB4018: at Microsoft.Build.Tasks.MSBuild.Execute()
error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
Done building target "CoreCompileSolution" in project "TFSBuild.proj" -- FAILED.
Done Building Project "C:\TFS\REPOSITORY\Full\BuildType\TFSBuild.proj" (CompileSolution target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "CoreCompileConfiguration" in project "TFSBuild.proj" -- FAILED.
Done Building Project "C:\TFS\REPOSITORY\Full\BuildType\TFSBuild.proj" (CompileConfiguration target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "CoreCompile" in project "TFSBuild.proj" -- FAILED.
Done Building Project "C:\TFS\REPOSITORY\Full\BuildType\TFSBuild.proj" (CoreCompile target(s)) -- FAILED.
Done executing task "MSBuild" -- FAILED.
Done building target "CallCompile" in project "TFSBuild.proj" -- FAILED.
I know pasting incredibly verbose error messages in Stack Overflow is lame but the core thing to take from the above is MSBuild is crashing and I can't figure out why. It gives the usual "Object reference not set..." error, which is pretty much universally useless when it's not your code or program you're troubleshooting.
I see that it's referencing TeamFoundation.Build.targets. I look up that file that file but it doesn't really jump out at me what the problem could be. (the line after the comment is the (1008,5) referenced above)
<!-- Build using MSBuild task -->
<MSBuild BuildInParallel="$(BuildSolutionsInParallel)"
Projects="$(Solution)"
Properties="Configuration=$(Configuration);Platform=$(Platform);$(OutDirOption);$(PublishDirOption);SkipInvalidConfigurations=$(SkipInvalidConfigurations);$(FxCopDirOption);$(ReferencePathOption);$(CodeAnalysisOption);
VCBuildOverride=$(VsPropsFile);VCBuildAdditionalLibPaths=$(VCBuildAdditionalLibPaths);VCBuildAdditionalOptions=$(VCBuildAdditionalOptions);VCBuildToolPath=$(VCBuildToolPath);VCBuildUseEnvironment=$(VCBuildUseEnvironment);
TeamBuildConstants=$(TeamBuildConstants);TargetsNotLogged=$(TargetsNotLogged);$(CustomPropertiesForBuild);$(CustomProperties)"
Targets="$(Targets)"
StopOnFirstFailure="$(StopOnFirstFailure)">
<Output TaskParameter="TargetOutputs" ItemName="CompilationOutputs" />
</MSBuild>
At first I thought this was telling me that one of the items that need to be substituted in the node was missing, but the other solutions which don't have issues have similar/identical setups.
I notice some of the items in the call stack of the MSBuild deal with targets and the issue seems to stem from the TeamFoundation.Build.targets file but I'm stuck as to what to do next to troubleshoot it.
Has anyone run into this before?
I believe the solution file is corrupt, and VS is being more tolerant. (If I remember correctly this crash can be caused by an unmatched curly parenthesis)
If it's feasible, I would recreate the solution file from within VS.
Dan (msbuild team)
When you said:
The actual solutions themselves and the projects they hold build correctly
do you mean that they build correctly within the IDE, or that you can go to those solution directories on the command line and run 'msbuild foo.proj' or 'msbuild bar.sln'?
Anyway, things I would try are first narrow down the offending solution/project, by telling TFS not to build in parallel, turn off multi-CPU support (e.g. '-maxcpucount:1'), do a binary search by trimming away solutions/projects. Once you get to the offending set, build with the '-v:diag' parameter to get even more details about the state of the MSBuild engine.
Alternately, you can write a small C# app that invokes the MSBuild engine directly and debug that application by catching first chance exceptions and having Reflector handy. See
sample code in MSBuild Engine Class.
Hmmm. You get a NullReferenceException, meaning that one of the parameters into that task is a null when it shouldn't be. Dumb question, but have you set up your TFSBuild.proj file with the solutions you want to build? IE. the stuff you put into the
- Itemgroup.
If you have, I would suggest adding message tasks to the Teambuild targets file just above the failing task to write out diagnostic information, like so:
That should spew some diagnostics info into your buildlog just above the log exerpt you pasted on your next build.
You may want to give the MSBuild-Sidekicks a try. They have a nifty little debugger for MSBuild included and offer a 14-day trial version: http://www.attrice.info/msbuild/

Resources