locked
Cannot find type System.Windows.Controls.Control in module System.Windows.dll

    Question

  • I am porting Windows Phone App to Windows store and I am getting the above error and I haven't Used Microsoft.Phone.Controls , So Can Anybody Please Advice 
    Monday, October 21, 2013 12:15 PM

Answers

  • You'll have to search your project for the references. I can't give you more details without seeing the project.

    System.Windows.Controls is part of Silverlight for the Phone so will be used by all controls in a Phone app. Custom controls will inherit and call it. It is not valid for Windows Store apps, so any references to it will need to be changed. Many of the common controls (Buttons, etc.) will be in the Windows.UI.Xaml namespaces.

    --Rob

    Wednesday, October 23, 2013 6:41 PM
    Owner

All replies

  • I strongly recommend you read the Resources for Windows Phone developers documentation.

    Windows Store apps don't use System.Windows.Controls or Microsoft.Phone.Controls. The Xaml controls are in Windows.UI.Xaml . You will need to rewrite your UI rather than directly translate it since the controls available.

    --Rob

    Monday, October 21, 2013 3:28 PM
    Owner
  • Sir,

    I am not using System.Windows.Controls but still I am getting this error any advice .

    Tuesday, October 22, 2013 10:24 AM
  • That error strongly suggests that you are using System.Windows.Controls. If you aren't doing so explicitly (I'd do a find in files for the entire solution) then you may be calling an assembly which uses it.

    --Rob

    Tuesday, October 22, 2013 11:20 PM
    Owner
  • Sir,

    Can you suggest me a bit that which part of controls like button and others calls for system.windows.controls as if any of the controls were the part of the system.windows.controls then it would have generated such error in a particular line number as it is not even suggesting me a line number or something which would generate such error.

    Wednesday, October 23, 2013 7:13 AM
  • You'll have to search your project for the references. I can't give you more details without seeing the project.

    System.Windows.Controls is part of Silverlight for the Phone so will be used by all controls in a Phone app. Custom controls will inherit and call it. It is not valid for Windows Store apps, so any references to it will need to be changed. Many of the common controls (Buttons, etc.) will be in the Windows.UI.Xaml namespaces.

    --Rob

    Wednesday, October 23, 2013 6:41 PM
    Owner
  • Salil,

    I encountered a similar issue and found that the issue was to due to Microsoft.Advertising.Mobile.UI having a reference to System.Windows.Controls.Control 

    If your Windows Phone app was using an Advertising Control, I would suggest taking a look as this may be the culprit.

    -Paul

    • Proposed as answer by Ajit Yadav Monday, April 6, 2015 7:03 PM
    Thursday, July 3, 2014 4:34 AM
  • I had added a reference to Google AdCenter Dll that in turn had a reference to System.Windows.Controls. Removing the reference fixed the issue.
    Monday, April 6, 2015 9:26 PM