Bug 56640 - 2.3.4.247 : DebugType parameter in Xamarin.Forms.targets prevents compilation success
Summary: 2.3.4.247 : DebugType parameter in Xamarin.Forms.targets prevents compilation...
Status: NEEDINFO
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.4
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 56579 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-05-18 19:18 UTC by webmetender
Modified: 2017-10-06 17:19 UTC (History)
15 users (show)

See Also:
Tags: xamlc
Is this bug a regression?: ---
Last known good build:


Attachments

Description webmetender 2017-05-18 19:18:34 UTC
After updating Xamarin and Xamarin.Forms to 2.3.4.247, each compilation attempt was leading to this error:

...\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets(68,4): error MSB4064: The "DebugType" parameter is not supported by the "XamlCTask" task. Verify the parameter exists on the task, and it is a settable public instance property.
...\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets(62,3): error MSB4063: The "XamlCTask" task could not be initialized with its input parameters.

Removing the line "DebugType = "$(DebugType)" " from Xamarin.Forms.targets allowed the app to compile and run again.

Looks like the DebugType parameter was left in Xamarin.Forms.targets by mistake?

A.
Comment 1 Stephane Delcroix 2017-05-18 19:30:19 UTC
this can have multiple causes:

- you updated XF but haven't reloaded the solution (restart your IDE)
- some projects in your solution points to different versions of Xamarin.Forms.

if the problem persists, please reopen the issue, and attach a solution causing the issue
Comment 2 Stephane Delcroix 2017-05-18 19:30:33 UTC
*** Bug 56579 has been marked as a duplicate of this bug. ***
Comment 3 David 2017-06-10 22:51:00 UTC
This is still a problem, even after verifying everthing points to the same version, cleaning, closing VS, deleting all bin and obj directories, and reopening solution in VS. Typical poor quaity of released versions fom the Xamarin Forms team. Come on guys. This is rediculous. You are supposed to be professionals.
Comment 4 David Ortinau [MSFT] 2017-06-11 22:15:29 UTC
@webmetender@gmail.com please provide a solution demonstrating this issue.
Comment 5 Stephane Delcroix 2017-06-12 09:49:56 UTC
Same for @dallen@qmobilesolutions.com. please provide a reproduction so we can investigate
Comment 6 webmetender 2017-06-12 12:49:41 UTC
@david.ortinau@microsoft.com 

What information would be useful for you to be able to investigate further?

Here is some:

Visual Studio Enterprise 2015 V 14.0.25431.01 Update 3
Xamarin 4.5.0.443

The project which would not compile was created more than a year ago.
It is a PCL project, not using XAML.
After updating Xamarin a month ago, it was impossible to compile the andoid app.
"MSB4064: The "DebugType" parameter is not supported by the "XamlCTask" task."
Comment 7 David Ortinau [MSFT] 2017-06-12 15:24:21 UTC
@webmetender@gmail.com 

We need a solution/project we can run, either that project or one that you are able to share that demonstrates the issue. You may also share it privately with us if there is a concern, and/or we can pursue an NDA so you can share it.

Some tips to make the upload smaller:
- do a clean/obliterate on the solution to remove bin and obj folders
- don't include the packages folder
Comment 8 webmetender 2017-06-12 15:27:18 UTC
@david.ortinau@microsoft.com 

Confidentiality concerns forbid me to share the exact project on which this occured.

I'll try to find some time to reproduce the issue in a dummy/simple Xamarin.Forms project and then share it with you.
Comment 11 Stephane Delcroix 2017-06-16 07:56:14 UTC
As the reporter can't provide a repro, I'm re-closing this.

Feel free to reopen if/when you have a valid reproduction project triggering the issue.
Comment 12 José Fabio Martinez Gonzalez 2017-06-16 11:16:44 UTC
Dear Stephane,

I am experiencing the same problem as the reporter.
But it's very random and not reproducible.

Since many people are experiencing this bug it is there. Therefore I would not close it unless someone can provide some more information or a fix
Comment 13 tycho 2017-06-23 06:41:55 UTC
This issue is definitely not closed. It happens all the time but is hard to reproduce when you want it. Just work normally on a project and it'll pop up. Very annoying. What I found works is just deleting all the bin/obj files of the projects (not CLEAN as that doesn't help) and build. Which should prove that it's *not* mismatched versions or something else 'we' did wrong; it's a Xamarin bug as the solution works fine most of the time. Not sure others are using it as well, but for me it happens only in PCL projects.
Comment 14 David Ortinau [MSFT] 2017-06-23 13:24:48 UTC
We need a project that suffers from this issue so we can confirm and address it. If you have one, please post it here or contact me directly to share it. david.ortinau@microsoft.com
Comment 15 tycho 2017-06-23 13:27:45 UTC
I will try to make one, give me the weekend and I will either post it somewhere or I will, in confidence, send you the one I am working on. The only way I can work longer stretched of the time without restarting VS is by removing DebugType from .targets at this moment which someone in the Xamarin forums suggested as 'bandaid solution'. I will try to get a project to act up this weekend and will just send it straight to you as a zip including all bin/obj dirs.
Comment 16 Stephane Delcroix 2017-06-23 14:22:55 UTC
if removing DebugType from .target fixes it for you, it means that sometimes, for some reason, a Xamarin.Forms.Build.Tasks.dll is loaded instead of the latest one.

so my money is still on your project referencing, directly or indirectly, multiple versions of that assembly, coming from different nuget packages.

of course, it could be something else...
Comment 17 tycho 2017-06-24 10:25:44 UTC
I could not find anything of that, I will look closer. I am trying to reproduce in a clean project now. 

However, if it's mismatched versions somehow, it would be nice if we can have some warning + quick fixer dialog for that as many people (only in our office this happens a lot and generally on the web the past months as well) seem to have a lot of dependency versioning issues with Xamarin. Some 'mismatched version in dependencies found, fix yes/no?' would be better.
Comment 18 Rashun Mosley 2017-06-25 02:38:14 UTC
Here's my scenario and environment.  

Development Machine MAC OS, running Visual Studio for Mac 7.0.1 Build 24

"Local" builds using solution which contains a:

PCL Project (Common Models, ViewModel, Views etc) .Net Profile 111.  (.Net Standard 2.0 causes other issues)
Common.Service .Net (Reference PCL and is consumed by Webservice) - Targeting .Net 4.5.2
iOS (Xamarin.iOS project)

"Local" project builds fine and consistently.  Latest version of Xcode latest version of the .Net framework

"Build Agent" is also the same MAC, leveraging Mobile Center Build services calling into Remote Agent.

This build fails every time.  Seems to be build and Build Task related, not IDE related.  Please keep this issue open.

"/Users/ci/agent/vstsagent/_work/1/s/iOS.sln" (Rebuild target) (1) ->
"/Users/ci/agent/vstsagent/_work/1/s/iOS/iOS.csproj" (Rebuild target) (2) ->
"/Users/ci/agent/vstsagent/_work/1/s/iOS.Services/iOS.Services.csproj" (default target) (4:3) ->
(XamlC target) -> 
  /Users/ci/agent/vstsagent/_work/1/s/packages/Xamarin.Forms.2.3.4.247/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(68,4): error MSB4064: The "DebugType" parameter is not supported by the "XamlCTask" task. Verify the parameter exists on the task, and it is a settable public instance property. [/Users/ci/agent/vstsagent/_work/1/s/iOS.Services/iOS.Services.csproj]
  /Users/ci/agent/vstsagent/_work/1/s/packages/Xamarin.Forms.2.3.4.247/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(62,3): error MSB4063: The "XamlCTask" task could not be initialized with its input parameters.  [/Users/ci/agent/vstsagent/_work/1/s/iOS.Services/iOS.Services.csproj]
Comment 19 Rashun Mosley 2017-06-26 05:14:56 UTC
Was able to identify the Xamarin.Forms.2.3.4.247 NuGet Packages were not checked into the Git Repository.  It was available locally, but not in Source Control.  Hopefully this helps others.
Comment 20 rfreschi 2017-06-26 19:14:36 UTC
For me this issue is only happening on my PC using VS2015 with Xamarin.Forms.2.3.4.247. 0 projects in my solution will build.

After much cleaning, obliterating etc. the ONLY fix was to revert to Xamarin.Forms.2.3.4.231
Comment 21 José Fabio Martinez Gonzalez 2017-06-27 13:33:12 UTC
I tried many solutions with deleting bin & obj folder, clean, rebuild, changing build configurations etc. but the only reliable workaround for me is to close and reopen Visual Studio for Mac and if that doesn't help then I restart my Mac.
Comment 22 tycho 2017-06-30 17:44:07 UTC
I still don't have a project I can send over, but I can make it happen now reliably; just take any 'old' (1 year) project and update the NuGet packages of the project to the latest, then compile. It happens that way for me every single time. I removed the flag from the targets file now in over 40 projects the past days and everyone I know now has complained about this. Hope this helps in fixing it... I'll continue to try to find a small project I can send that has it.
Comment 23 Ton Snoei 2017-07-05 11:03:17 UTC
This iss a reaction on the email of DavidOrtinau on 30th of june about this issue. I have this issue in a Visual Studio solution containing:
- Portable project
- Android project
- iOS project
- 2 other portable library projects (referenced by the portable project)
- 2 Unit Test Android projects
- 1 WinForms project 

The Android, iOS and portable projects have Xamarin.Forms referenced via NuGet and all use version 2.3.4.247.

This issue as described in this report re-appears frequently. It seems to occur when the time between compiles is more than around 30 minutes or after a large code change or a change within the references libraries and the main project. I cannot reproduce it, even when I tried to. I had the problem today 3 times today between 08:30 and 13:00(= time of writing). 

When it occurs it CANNOT be solved by rebuilding or cleaning the solution or projects. The only way to solve it is to restart Visual Studio 2017 WITHOUT rebuilding or solution cleaning.
Comment 24 Ton Snoei 2017-07-05 11:03:41 UTC
This iss a reaction on the email of DavidOrtinau on 30th of june about this issue. I have this issue in a Visual Studio solution containing:
- Portable project
- Android project
- iOS project
- 2 other portable library projects (referenced by the portable project)
- 2 Unit Test Android projects
- 1 WinForms project 

The Android, iOS and portable projects have Xamarin.Forms referenced via NuGet and all use version 2.3.4.247.

This issue as described in this report re-appears frequently. It seems to occur when the time between compiles is more than around 30 minutes or after a large code change or a change within the references libraries and the main project. I cannot reproduce it, even when I tried to. I had the problem today 3 times today between 08:30 and 13:00(= time of writing). 

When it occurs it CANNOT be solved by rebuilding or cleaning the solution or projects. The only way to solve it is to restart Visual Studio 2017 WITHOUT rebuilding or solution cleaning.
Comment 25 Jason H. 2017-08-03 18:57:21 UTC
Hey, all. I'm new to Bugzilla (and relatively-new to Xamarin) so forgive me if I'm posting anything irrelevant... but I think I found a Forms solution in which the errors seem to be occurring regularly: https://github.com/xamarin/xamarin-forms-samples/tree/master/Navigation/TabbedPage.

I can verify I'm also running Visual Studio 2017 Community, on the Mac, with the Xamarin.Forms NuGet package at version 2.3.4.247.
Comment 26 David Ortinau [MSFT] 2017-08-03 19:04:47 UTC
@Jason,

Please clean the project, delete the bin/obj folders, and zip up the solution files minus the packages directory. Then post that here. The GitHub version doesn't use 2.3.4.247, so we want to inspect all your projects and config.

Also, in Visual Studio go to About > Show Details and copy all that info into a Gist for us. 

Thanks!
Comment 27 Adam Hill 2017-08-09 16:50:13 UTC
For me a simple repro is to grab https://github.com/onovotny/SampleXamFormsWithNetStandard from Github. 

Open up in VS Mac Preview, Alpha Channel, 7.2 Preview (Build 478). I immediately get the "XAMLC..." error when trying to compile.

After cleaning up /bin and /obj I get:

AppDelegate.cs(14,48,14,55): error CS0400: The type or namespace name 'Xamarin' could not be found in the global namespace (are you missing an assembly reference?)
    AppDelegate.cs(23,30,23,47): error CS0115: 'AppDelegate.FinishedLaunching(UIApplication, NSDictionary)': no suitable method found to override

VS 2017 - No errors.
Comment 28 P Ernsdorff 2017-10-06 17:19:36 UTC
After frustration with this same issue, I finally found that in some project files (.csproj) there was a left over Import of the previous version of Xamarin.Forms

  <Import Project="..\..\packages\Xamarin.Forms.2.3.4.247\......
  <Import Project="..\..\..\..\packages\Xamarin.Forms.2.4.0.282\.....

Cleaned this up, deleted all obj/bin folders, all good now.

Note You need to log in before you can comment on or make changes to this bug.