Bug 28205 - Xamarin Studio builds no targets
Summary: Xamarin Studio builds no targets
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: ASP.Net ()
Version: unspecified
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Matt Ward
Depends on:
Reported: 2015-03-19 14:05 UTC by Jeffery Grajkowski
Modified: 2015-12-11 16:19 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Project demonstrating the bug. (18.12 KB, application/zip)
2015-03-19 14:05 UTC, Jeffery Grajkowski

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 28205 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Jeffery Grajkowski 2015-03-19 14:05:25 UTC
Created attachment 10416 [details]
Project demonstrating the bug.

I've got a project where building from Xamarin studio does essentially nothing.  The log indicates it's building and then that it's done.  If I build with xbuild from the command line the project builds as expected.  This project also works fine in Visual Studio and with msbuild.

I've recreated the problem with a stripped-down project that I have attached.  Building the project requires node and the typescript module.  (npm install -g typescript)

Xamarin Studio log:
Building Solution: BugReport (Debug)

Building: BugReport (Debug)

---------------------- Done ----------------------

Build successful.

Console build log:
> xbuild BugReport.sln
XBuild Engine Version 12.0
Mono, Version
Copyright (C) 2005-2013 Various Mono authors

Build started 2015-03-19 10:53:14 AM.
Project "/Users/latitude/Projects/BugReport/BugReport.sln" (default target(s)):
	Target ValidateSolutionConfiguration:
		Building solution configuration "Debug|Any CPU".
	Target Build:
		Project "/Users/latitude/Projects/BugReport/BugReport/BugReport.csproj" (default target(s)):
			Target PrepareForBuild:
				Configuration: Debug Platform: AnyCPU
			Target GenerateSatelliteAssemblies:
			No input files were specified for target GenerateSatelliteAssemblies, skipping.
			Target CompileTypeScript:
				Compiling TypeScript files...
				Executing tsc @__typeScriptArgs.txt 2>&1
				Executing: export PATH=$PATH:/usr/local/bin/ && tsc @__typeScriptArgs.txt 2>&1
			Target CoreCompile:
				Skipping core compile
		Done building project "/Users/latitude/Projects/BugReport/BugReport/BugReport.csproj".
Done building project "/Users/latitude/Projects/BugReport/BugReport.sln".

Build succeeded.
	 0 Warning(s)
	 0 Error(s)

Time Elapsed 00:00:02.3703940

Xamarin details:
=== Xamarin Studio ===

Version 5.8 (build 443)
Installation UUID: 3836c44a-2246-4e14-a521-c8cda76811ec
	Mono 3.12.1 ((detached/b7764aa)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312010000

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.Mac ===

Not Installed

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: ccfcd59
Build date: 2015-03-10 02:20:32-0400

=== Xamarin.Android ===

Version: (Business Edition)
Android SDK: /Users/latitude/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.4   (API level 19)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 508000443
Git revision: 73883239470cbe8e261c94d95f7c3d0452fd393b
Build date: 2015-03-10 07:22:51-04
Xamarin addins: a2ff7b617f09d9c45d8bbf3d010b5db0d7d36100

=== Operating System ===

Mac OS X 10.9.5
Darwin Latitudes-Mac-3.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 1 Mikayla Hutchinson [MSFT] 2015-03-22 03:32:26 UTC
What does the build log in XS say?
Comment 2 Mikayla Hutchinson [MSFT] 2015-03-22 03:34:34 UTC
The issue is probably that your project doesn't have any defined build configurations, which is not currently supported by XS.
Comment 3 Jeff Siemens 2015-03-23 14:37:46 UTC
The project is in the build configuration:
- Right click solution > options > Build / configurations > Debug > (project is checked)

The build log is as specified (even with log verbosity set to diagnostic).

Building: BugReport (Debug)

---------------------- Done ----------------------

Build successful.
Comment 4 Mikayla Hutchinson [MSFT] 2015-03-23 21:40:51 UTC
Right, but the *project file* defines no configuration propertygroup corresponding to the values mapped to it by the solution. Although this is valid MSBuild, it's not currently supported by XS.
Comment 5 Jeff Siemens 2015-03-24 13:38:18 UTC
Thanks Michael. I don't entirely understand what you mean. Would you be able to elaborate on how to define a configuration property group that maps to the solution?
Comment 6 Mikayla Hutchinson [MSFT] 2015-03-24 16:56:51 UTC
See the Configurations and Platforms section here:


It's basically a standard pattern of "set these MSBuild properties if the Configuration|Platform properties have values X|Y" that VS/XS recognize as "the project file has a configuration called X|Y".

It's not strictly necessary to define a configuration to be able to build the project with those Configuration|Platform property values - the build might not care about the values of the Configuration and Platform properties, or the values might be interpreted in an imported target. But XS currently requires the configuration to exist.
Comment 7 Jeff Siemens 2015-03-25 16:14:20 UTC
It seems OK to me. 


	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{10E4F52B-ECD9-4A2F-99CB-15F68B252D24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{10E4F52B-ECD9-4A2F-99CB-15F68B252D24}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{10E4F52B-ECD9-4A2F-99CB-15F68B252D24}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{10E4F52B-ECD9-4A2F-99CB-15F68B252D24}.Release|Any CPU.Build.0 = Release|Any CPU


    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">

What's missing?
Comment 8 Jeffery Grajkowski 2015-03-31 11:11:44 UTC
Hi Michael,

Could you explain the problem with the project further?  The line:
  <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
seems to cover what you're saying.

Comment 9 Lluis Sanchez 2015-04-10 07:33:12 UTC
This is certainly a bug. The project doesn't build because of this check:


The project is using the TypeScriptCompile build action instead of Compile, so the check thinks there isn't anything to compile.
Comment 10 Jeff Siemens 2015-04-10 11:51:35 UTC
Thanks Lluis for figuring this out! Indeed, I am able to get the project to build by simply adding a csharp class file.
Comment 11 Matt Ward 2015-05-05 08:29:03 UTC
If the AspNetAppProject is changed to allow a build, if the project has a file that is using a TypeScriptCompile build action, then this will fix the problem for the attached project but it will then cause build errors for TypeScript projects created by Visual Studio.

TypeScript projects created by Visual Studio are web projects that have TypeScript specific MSBuild imports.

  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props')" />

  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets')" />

Mono does not have these custom .targets so the build will fail, if we allow the build to run with TypeScriptCompile files, with a Csc error "No files to compile were specified". This error is what the original code in the AspNetAppProject was handling.

The ideal solution would be that these TypeScript projects would just work out of the box in MonoDevelop. That would mean shipping the TypeScript targets, possibly our own implementations that work cross platform. It would need an MSBuild task that ran the TypeScript compiler, which is written in TypeScript. Currently the TypeScript compiler for Linux and Mac is available through Node. Mono could use that or alternatively Mono could ship its own TypeScript compiler that uses V8.NET.

The TypeScript addin, currently a separate install, does not support TypeScript projects with these custom MSBuild targets files. Instead it just compiles the TypeScript files in MonoDevelop without relying on MSBuild. This allows TypeScript files to exist in any project. However we would still want the TypeScript addin to work with projects created by Visual Studio.
Comment 12 Jeffery Grajkowski 2015-05-05 11:25:17 UTC
The csproj included in this report was created in Visual Studio 2013 with the TS 1.4 plugin.  I added the conditional include pointing to my own Microsoft.TypeScript.Mac.targets file.  That targets file is based on an earlier TypeScript targets file.  The result isn't a great development experience for TypeScript but it compiles which is enough for my purposes.

Since this bug was filed Microsoft has release Visual Studio Code which comes out of the box with TypeScript support.  It might be worth seeing how they did it.  http://blogs.msdn.com/b/typescript/archive/2015/04/30/using-typescript-in-visual-studio-code.aspx

In addition to solving the problem for TypeScript specifically, Xamarin Studio should log that it is building no targets because no cs files are found.  That will minimize confusion for other scenarios.