"The tag 'MenuItem' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit'" error - xaml

I'm getting an error trying to build a Silverlight application on a new machine. (Silverlight 4, Visual Studio 2010) This application compiles without error on four other machines.
The error is:
the tag 'MenuItem' does not exist in XML namespace 'clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit'.
The references appear to be pointer to the correct assemblies. Has anyone else ever had this problem?

Another reason this issue may occur is due to missing a reference to all "three" assemblies required to use the portions of the the Toolkit controls.
Make sure you have reference to the following assemblies if attempting to use the Toolkit inputs (and assuming the themes also possibly).
System.Windows.Controls
System.Windows.Controls.Toolkit
System.Windows.Controls.Input.Toolkit
This solved the problem I was having in relation to the error.

http://marktinderholt.wordpress.com/2011/07/12/silverlight-toolkit-for-silverlight-5-beta
its the recompiled toolkit in SL5, just reference those and you're set

You can always fall back on creating the context menu in code.
public LedgerEntryControl()
{
InitializeComponent();
ContextMenu contextMenu = new ContextMenu();
MenuItem voidMenuItem = new MenuItem() { Header = "Void" };
voidMenuItem.SetBinding(MenuItem.CommandProperty, new Binding("Void"));
contextMenu.Items.Add(voidMenuItem);
ContextMenuService.SetContextMenu(this, contextMenu);
}

looks like you're missing the Silverlight Toolkit on that machine, but it's installed on the four other ones.

For some reason, the SilverLight Toolkit from NuGet Package Manager is for SL4, even when the project is set to SL5. You can download the SL5 version directly from CodePlex. Note that the date is December 2011, instead of February 2011 like the SL4 version.
If for some reason the MSI does not install (which happened to me), you can extract the files contained in the MSI using 7-zip. All I had to do was manually add a reference to System.Windows.Controls.Input.Toolkit.dll from the extracted files, and my SL5 project now compiles successfully with its NumericUpDown control. Happily, my program now compiles both in Release and Debug mode.
Also to add, for those who have not already done so, you may need to have a reference in the XAML to the correct toolkit. I used the following:
<sdk:Page xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" ... >
Note that the first part, where is says input, is what needs to be typed in the XAML to use the control:
<input:NumericUpDown x:Name="myControl" ... />

Related

"The type or namespace name 'App' could not be found" Xamarin Forms

I am trying to create a simple app in Xamarin Android with Xamarin Forms using Visual Studio, however I keep getting this error everytime I try to build. I have double checked my references which should contain the Portable project, as well as made sure I have the latest version of Xamarin.Forms. What could I still be missing that would give this error?
using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using App2;
using Xamarin.Forms.Platform.Android;
namespace App2.Droid
{
[Activity(Label = "App2", Icon = "#drawable/icon", MainLauncher = true,
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity :
global::Xamarin.Forms.Platform.Android.FormsApplicationActivity // superclass new in 1.3
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App()); // method is new in 1.3
}
}
}
In my case, I found there is a bug with Visual Studio 2017 when making a cross platform Xamarin Form app with the generated code if there is a dash in the filename.
It looks like it tries to snake case the title and then complains about not finding that file.
For example, for "my-project", it starts looking for "my_project" in some areas of the generated code.
Using a project name with no symbols seems to solve the issue.
If you're still having issues check to see that the PCL project is referenced under the references in the solution explore
the refrences option in the solution explore
Right click on the references option and click add reference.
in the dialogue box, select the PCL project and click okay.
this should solve the error
Found the source of the error! If anyone else is struggling, try updating Xamarin.Forms using NuGet Packages for Solution. I was only using the Package Manager Console which was not giving me the latest version.
Check whether the namespace you defined in pcl under which the class App() is created is defined in Android project. For example, If your pcl class App() is present under the namespace called App2, then you need to add this namespace in Android project as follows,
using App2;
Check this out if the problem is still not resolved :
Go to
project -> Reference - right click and select -.> Add reference -> from left side
select Project -> solution -> then (check ) select Project name --> OK
finish
I was renaming the projects of the solution and had this same error. What I have done is delete the reference to the .Net Standard project and readded with the new name to the Android project.
My case is really rare but I had the same issue and the problem was that I referenced two pcl projects that referenced Xamarin.Forms (one standard shared project and another my custom library with UI controls). Removing dependency to the second one solved the problem.
This answer is not related to Xamarin, but might help others in the future seeing the same error message. This was an ASP.NET 5.0 Blazor Web Assmebly project and I was developing using Visual Studio for Mac.
I got this error when I had renamed a project from Foo to FooBar.
It turns out, VS did not refactor the namespaces in any classes I created, so the root namespace was left as Foo, which was where the startup Program class was, yet the framework was searching for the App.razor file in the project root, which had been renamed to FooBar.
To fix this, I simply renamed the namespace of the Program class from Foo to FooBar.
In my case, the android and iOS projects could not find the PCL.
I had to import the PCL as a project into Android and iOS. Rebuild solution and you should be fine!

Reduce DevExpress theme dll's on deploy folder

Using the
DevExpress Assembly Deployment Tool
helps finding out the needed dll's depending on your references. In my case I have as a reference just DevExpress.Xpf.Charts.v16.1.
The total amount of dll's to deploy from DevExpress is 33. From those, 20 are DevExpress.Xpf.Themes.XXX related.
I understand that depending on the context you can have different themes, like aero, metro, win xp...
Is there any way to reduce the amount of dll's in the deploy folder.
Or
Is there any way to 'fix'/'hardcore' the theme to be used and have just one of them deployed?
Refer this DevExpress Thread - Could not load file or assembly DevExpress.Xpf.Themes...
Starting with version 16.1, the default application theme is "Office2016White". Thus, it is required to add a reference to the DevExpress.Xpf.Themes.Office2016White.v16.1 assembly in your project if it uses the default theme.
In addition, the default theme is now applied to standard WPF controls, not only DevExpress ones.
To switch to another theme, use the ApplicationThemeHelper.ApplicationThemeName property. The DevExpress.Xpf.ThemeManager.ApplicationThemeName property has become obsolete.
To restore the old behavior, set the DevExpress.Xpf.Core.ApplicationThemeHelper.UseLegacyDefaultTheme property to true before the first reference to the DevExpress.Xpf.Core.v16.1 assembly. See the example below:
public partial class App : Application {
public App() {
ApplicationThemeHelper.UseLegacyDefaultTheme = true;
}
}
The value of the static Theme.Default property has been changed to Office2016White.
For the answer of you question, You can just add that theme assembly which your added controls use. If you have changed theme from different control by modifying some properties then you have to be careful about that required assemblies.
Hope this help..

Website hosted by IIS doesn't support VB 14 new features?

I'm trying Read-only auto-properties today. VS2015 doesn't complain about the new syntax, but when I view the page in browser it shows error "BC36714: Expanded Properties cannot be initialized."
Do I forget to set anything?
Update:
Public ReadOnly Property Tags As New List(Of String) causes the same compilation error.
It works fine on my VS2015 Pro update 2, with .NET 4.6 - The only thing i can think of is that it is a bug that may be fixed in that update.

Skip is not a member of System.Data.EnumerableRowCollection(of System.Data.DataRow)

I am working on jqGrid paging and it was working perfectly ok when I was working in a separate application. I moved it to the existing project and keep getting this error.
And If I try and add reference to System.Data.DataSetExtensions it says it doesn't contain any public member or cannot be found.
This works for me in my project, where table is a Datatable, and this code builds fine.
table.AsEnumerable().Skip(5).Take(5)
Are you missing any necessary import statements and DLL references for some reason? Is dtWORData a DataTable object directly, right? Seems like yes, because your popup lists EnumerableRowCollection, which my example shows too when I mouse over it in visual studio.

MVCAwesome, MVC4 and NuGet

I created a new MVC4 project using Razor syntax, and used NuGet to add MVCAwesome.
Looking at this page, it appears that all the expected files and configuration files appear to be in place. I made the edit to the Views/Web.config as directed.
When I try to reference any Awe() controls however, the reference to Awe() shows up in red text, and I get an error message: Cannot resolve symbol Awe()
#Html.Awe().DatePickerFor(model => model.BirthDate).ChangeMonth(true).ChangeYear(true)
Has anyone gotten this to work? What am I missing?
Just FYI, I was able to contact the maintainer of this library. It turns out that in this newer, NuGet version of the controls, you don't need the Awe() part.
For some reason, DatePickerFor still seems to be missing, but I do see other controls there from the package.