I tried build UWP library on build server with MSBuild 2015 Tools. I have installed Windows 10 SDK and other needed tools, but I haven't Visual Studio 2015. When I try build with this command:
msbuild mySolution.sln /t:Rebuild/p:Configuration=Release;Platform=x86;AppxBundlePlatforms=x86;AppxBundle=Always
or try this examples:
compilebuild-the-uwp-project-from-command-line, is still not working and I got errors:
...
error CS0518: Predefined type 'System.Boolean' is not defined or imported
error CS0518: Predefined type 'System.Void' is not defined or imported
error CS0518: Predefined type 'System.Object' is not defined or imported
error CS0518: Predefined type 'System.Int32' is not defined or imported
error CS0518: Predefined type 'System.Void' is not defined or imported
error CS0518: Predefined type 'System.Boolean' is not defined or imported
error CS0518: Predefined type 'System.Boolean' is not defined or imported
...
When I install VS, everything is ok, but I don't want install VS on build server.
Is it possible build UWP library/apps without Visual Studio?
pack and restore are now msbuild targets (2017).
try msbuild /t:restore and then msbuild.
Run this from a admin cmd prompt
Your need to ensure that the build machine runs <path_to_nuget.exe>\nuget.exe restore on the solution folder before running the msbuild command!
That will download all the nuget packages required by your solution!
Nuget.exe is not part of Visual Studio or the Windows SDK, so you might have to download it to the server first (or ensure you have a build script that does that for you)
Related
After adding MSBuild arguments:
/tv:14.0 /p:VisualStudioVersion=14
I get the following error message:
C:\Builds\10\IW_*****\Dev\src\Sites\******\Properties\CompileLicxFiles_Patched.targets (98): The "LC" task was not given a value for the required parameter "TargetFrameworkVersion".
I'm trying to build using VS2015 (TFS2013 server)
Found this: https://connect.microsoft.com/VisualStudio/feedback/details/1406942/new-required-lc-task-parameter-targetframeworkversion
However, I've checked and all projects in the solution have 4.5.2 version assigned.
Log (it seems it's still using VS2013):
Added package 'NEST.1.9.1' to folder ...
Added package 'FluentAssertions.4.17.0'....
...
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\MSBuild.exe /nologo /noconsolelogger "C:\Builds\10\IW_****\Dev\src\Solution123.All.sln" /nr:False /fl
To use VS 2015, the argument should be /p:VisualStudioVersion=14.0.
First thing first.
I was using VS2015 to edit TfvcTemplate.12.xaml build template which cased issues. For some reason, when using VS2015 - it was modifying the xaml document incorrectly. To make any type of changes to TfvcTemplate.12.xaml template you have to use VS2013!
TfvcTemplate.12.xaml does not contain "ToolPath" variable. To make this work I simply added "14.0" (quotes necessary) under "ToolVersion"
TFS2013 will use VS2015 MSBuild to run the build. No need for MSBuild command line switches. Works without them.
Output log:
Run MSBuild00:13:39 C:\Program Files\Microsoft Team Foundation Server
12.0\Tools\nuget.exe restore "C:\Builds\9************\packageRestore.proj" -NonInteractive MSBuild
auto-detection: using msbuild version '14.0' from 'C:\Program Files
(x86)\MSBuild\14.0\bin'.
You could also just modify your build definition with Visual Studio. On the process tab of the build definition that uses TfvcTemplate.12.xaml expand 2.5 section to see the MSBuild arguments. Add the below arguments to the build definition and save it. I assume your problem was you had /p:VisualStudioVersion=14 instead of /p:VisualStudioVersion=14.0.
/p:VisualStudioVersion=14.0 /tv:14.0
I have a VS 2013 console application that loads any solution(.sln) file - compiles all projects within it using Roslyn and extracts API usage information from the compilation model.
I am now facing this peculiar issue - When I run the application from within Visual Studio 2013 (using Ctrl-F5 or F5) everything works fine. I am able to compile stuff and extract all information.
However when I open a command line (cmd) and try to run this Console app from I get the following error:
Unhandled Exception: System.AggregateException: One or more errors occurred. ---> Microsoft.Build.Exceptions.InvalidProjectFileException: 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 <Impor
When I run
Note the v14.0 there. Why does MSBuildWorkspace try to look into v14.0 directory for required target files ? Is it because I installed the MSBuild tools for CTP and the default path while I run stuff from a simple command line has changed ?
--Edit--
Here is the import
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
However I doubt it is to do with the Import statement as such. If I run the console app .exe from the "Developer Command Prompt for Visual Studio 2013" everything works fine again.
You can make your Web Application projects self-contained and not require Visual Studio 2015 to compile by adding NuGet reference to MSBuild.Microsoft.VisualStudio.Web.targets.
I had this problem on my build server. When I targeted /tv:14.0 (Tool Version 14.0 which is the Roslyn Build engine)
I resolved it by going out to C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio then creating folders like v14.0\WebApplications
I then went out to my system with Microsoft.WebApplication.targets (because this is put out there by Visual Studio 2015) and copied that file out to the build servers new folder.
I am attempting to add a custom “activitycode” to a TFS Build. I wrote this months ago and had it working on a now defunct test environment. I am attempting to resurrect the use of the code onto a new test platform, and am running into issues.
When I open my build.xaml, I receive the dreaded red-box of pain where my custom activity should be, stating “Assembly could not be loaded because of an error in the XAML.” In the ErrorList, I also have found “Could not find type '.DeploySSRSReportActivity' in assembly 'ReportingServicesDeploy'.”
I have confirmed that my DLL is checked into source control and that the build controller is pointing to it.
Peeking into the raw XAML, I see that the build.xaml file defines the assembly as
xmlns:rsd="clr-namespace:;assembly=ReportingServicesDeploy
The line where my custom activity (and where V.S. finds the error) is:
<rsd:DeploySSRSReportActivity CurrentBuild="[BuildDetail]"
SourcesDirectory="[SourcesDirectory]"
mtbwt:BuildTrackingParticipant.Importance="High"
xmlns:mtvc="clr-namespace:Microsoft.TeamFoundation.VersionControl.Client;assembly=Microsoft.TeamFoundation.VersionControl.Client"
xmlns:mtvco="clr- namespace:Microsoft.TeamFoundation.VersionControl.Common;assembly=Microsoft.TeamFoundation.VersionControl.Common"
xmlns:ras="clr-namespace:ReportingServicesDeploy;assembly=ReportingServicesDeploy"
xmlns:rsd="clr-namespace:;assembly=ReportingServicesDeploy"
xmlns:sad="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sad1="clr-namespace:System.Activities.Debugger;assembly=System.Activities" />
The DLL is named ReportingServicesDeploy.dll. The namespace within the DLL is ReportingServicesDeploy, and the name of the activity class is DeploySSRSReportActivity.
Where is the linkage failing so that I am getting that error?
When your attempting to edit the xaml your doing this on your machine directly, tfs and sourcecontrol is not involved, the location on server for controller is where build agent will look for assemblies during the build and where VS will get them when opening build definition for config.
Your error possibly is coused by old version being used.
The assemblies must be available for visual studio on your machine - one option is to add them to GAC or to post in VS bin folders. Start new instance of studio afterwards
To intall into GAC run this from Visual Studio command line:
gacutil /i "Path\To\YourAssembly.dll"
To remove assembly run following from Visual Studio command line:
gacutil /u "YourAssembly"
For studio assemblies i believe this is the folder:
Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies
When building a solution on a machine without VS installed, and getting workflow compilation errors I would like to track down the source of the errors, but the msbuild output is not very helpful:
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets(80,3): error : The type or namespace name 'Foo' could not be found (are you missing a using directive or an assembly reference?)
An nothing about the file and line even with diagnostic level of verbosity.
However VS manages to find the file and line number.
I don't want to install VS on the machine we're doing builds on.
Is there a way to tell the workflow compiler to report source file names and line numbers for
compilation errors?
Thanks!
Can you build it on the command line using MSBuild on a machine in which it builds successfully using Visual Studio, or does it fail there as well?
Sayed Ibrahim Hashimi
My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build
I'm getting this error trying to run my Build thru TeamBuild in TeamExplorer on Visual Studio 2008.
On the Build Machine I installed VS SP1, Team Explorer, Silverlight 3 tools, and RIA Services.
I can compile no problem with Visual Studio on my machine and directly on the Build Machine. But I still cant compile on thru TeamBuild because it "says" I'm missing GetXapOutputFile target.
I checked C:\Program Files\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.Common.targets file and it does have the GetXapOutputFile target:
<!--
============================================================
GetXapOutputFile
This stand-alone target returns the name of the built xap file.It
only makes sense to call this after a build
============================================================
-->
<Target
Name="GetXapOutputFile"
DependsOnTargets="_CreateSLProperties"
Outputs="$(XapOutputFile)"
/>
Any idea what I might be missing?
Hi I was trying a command line build and had same issue, this solved it for me:
Properties menu of 'xxx.Web' project, 'Silverlight Application' tab, remove the current item and add it again. After that, when building..., the error will go away. But I don't know why it is.
Found here: http://connect.microsoft.com/VisualStudio/feedback/details/698689/error-msb4057-the-target-getxapoutputfile-does-not-exist-in-the-project