Bug 25952 - CS0103 error when building from command line with mdtool and unified api
Summary: CS0103 error when building from command line with mdtool and unified api
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.6.0
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-01-12 18:00 UTC by John Miller [MSFT]
Modified: 2015-01-19 09:30 UTC (History)
3 users (show)

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

Test Case (18.06 KB, application/zip)
2015-01-12 18:00 UTC, John Miller [MSFT]

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description John Miller [MSFT] 2015-01-12 18:00:27 UTC
Created attachment 9330 [details]
Test Case


   The attached sample will not build from command line after updating to the unified API.

**Steps to Reproduce:**

   1. Open terminal to the directory path of the attached project files
   2. Run this command

> /Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build -t:build "-c:Debug:iPhoneSimulator" -p:mdtool_bug/mdtool_bug.sln

**Actual Results:**

   Fails to compile

> AppDelegate.cs(25,4): error CS0103: The name `iOSAppExtension1' does not exist in the current context 
> AppDelegate.cs(26,4): error CS0103: The name `iOSAppExtension2' does not exist in the current context

**Expected Results:**

   No compilation issues

**Build Date & Platform:**

   XS 5.7
   XI 8.6

**Additional Information:**

   Was not an issue using the classic API. Solution builds fine in Xamarin Studio.
Comment 1 Sebastien Pouliot 2015-01-12 18:51:56 UTC
Unified applications requires `msbuild` (not the old, custom addin-based, build tools that mdtool can invoke). Just typing `xbuild` + ENTER works fine (as it picks up the .sln and the default project/config).

note: I'm not sure if mdtool can invoke msbuild automatically (but that would only be slower).
Comment 2 Volodymyr.Melnychenko 2015-01-19 04:40:18 UTC
Same result when launch xbuild from Xcode build phase.
Comment 3 Sebastien Pouliot 2015-01-19 09:17:43 UTC
I'm not sure what you mean by launching "xbuild from Xcode". Do you mean you're running this XI build from another build, run by Xcode ? and getting the same errors as above ?

That's likely because the environment (e.g. PATH) differs from your terminal (but first ensure it works from a terminal window).

A full (maximum diagnostics) build log that shows every steps will be needed to duplicate the issue.
Comment 4 Volodymyr.Melnychenko 2015-01-19 09:30:42 UTC
I send to support mail with updated environment to reproduces this issue at January 14, 2015 at 11:48 AM.
Temporary workaround: env -i xbuild build-parameters.