Click here to Skip to main content
15,867,834 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am making a windows phone 8 application, where i use LongListSelector and DatePicker.
the LongListSelector is from windows.controls
the DatePicker is from Windows.phone.Controls.toolkit (Date Picker is not-available in Windows.Controls).

** As soon as i Drag and drop DatePicker in my design it is adding Windows.phone.Controls.toolkit.dll to references and in XAML file.
and now while building the file its saying Error 1 The type 'Microsoft.Phone.Controls.LongListSelector' exists in both 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0\Microsoft.Phone.dll' and 'C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.1\Toolkit\Aug11\Bin\microsoft.phone.controls.toolkit.dll'
"
** I don't need Windows.phone.toolkit to work with my LongListSelector (as it LLS is from Windows.phone)

i want to use the controls in windows.controls.. how can i achieve this.
Posted
Updated 8-Jun-15 22:23pm
v4
Comments
Naz_Firdouse 9-Jun-15 3:52am    
How are you referencing LongListSelector in XAML...
share sample code
Aditya_Goud 9-Jun-15 4:27am    
@naz_Firdouse i am not referencing LLS .. because it is inherited from Windows.Controls.
Sergey Alexandrovich Kryukov 9-Jun-15 4:11am    
You have to either remove one of the references, or resolve the ambiguity.
—SA
Aditya_Goud 9-Jun-15 4:31am    
yes .. if i remove the reference LLS it works perfect .. But i cant use Date-picker ! beacuse its not listed in Windows.controls

1 solution

Working method
Delete the existing windows.phone.toolkit in references..
Right click on references.. Select Manage NuGet Packages
Go online and search for windows phone toolkit.. and install it,
then add
C#
xmlns:toolKit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
in your xaml file on the top.

then type
C#
<toolKit:you will get it 



Dont Follow this method
** Don't search for your control in toolbox and drop in UI .. it will cause same error , it will generate a .dll under references
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900