Intellisense not working - intellisense

Intellisense is not working correctly for new user Controls. Any class in the same namespace as my new class is not visible in intellisense. It compiles without any problem. I'm using VS 2008.

Can you restart your VS 2008 and see whether the problem goes away?

Close visual studio, delete the ncb file, then open it again

I solved the problem. I was trying to use another userControl inside my userControl and didn't register it. Since both userControls were in same namespace, it was compiling correctly.

Related

Windows forms not updating vb.net

I'm having to work in a vb.net project and I have to add new textfields and labels to a form. But when I change the layout of the form in Visual Studio the form looks fine, but after compilation and moving to a testserver the form all gets jumbled together and label/textfields are all over the place, and some are missing.
Why does this happens and how can I fix it? I think it could have something to do with form languages but I'm not sure. Since on test server there is a way to change the language from the app between dutch and french.
Was able to fix the the issue by compiling the code in visual studio 2010 instead of 2017. Thought i would give it a try since the application was initially developed in VS 2010 and it worked.

InitializeComponent does not exist

InitializeComponent();
This code line appeared in all my Xaml pages' constructors in code behind.
It throws the following error:
InitializeComponent does not exist.
Now I cannot debug any page in my project although I have commented out this line.
How can I fix this?
Any help would be greatly appreciated.
Note: I'm using Xamarin Forms Portable project.
Update: When I comment out this line and run the pages, only an empty screen shows up in both IOS and Android although my pages were working correctly without error before.
Update 2: now the InitializeComponent lines are disappeared but the pages that I debug are still totally blank.
I have asked a question about this new problem on here.
I had also the same problem in Xamarin Forms Application.I fixed it by changing the Build Action to:
Embedded resource
for .xaml and .cs file both using property window.
Hope it may help you.
Change something in the page, then save it. Scarily this resolves the issue sometime.
If that doesn't work.
Update your nugget packages so Xam Forms is the latest.
"Clean" your project
Go to your project dir and delete the bin and obj from your projects via File Explorer.
Rebuild it.
Good luck.
Be sure that your Xaml page has property Custom Tool set to MSBuild:UpdateDesignTimeXaml
'Its not an issue. You can try to build your solution. Hopefully it will bulid perfectly. Most of the time I also get red under line on InitializeComponent(); like you same. Its a problem of Xamarin studio and Visual studio'
Is it the first XAML page you create in the project? or you created other pages and they don't contain this problem?
you can Check the comments here: http://forums.xamarin.com/discussion/17638/initializecomponent-does-not-exist/p4
Have you renamed your page? All XAML pages have a viewable partial class (the one you enter your logic code in to) and a hidden, system generated partial class.
If you renamed the class but did not use the VS rename macro, your system generated partial class no longer matches your editable partial class.
Try running 'Clean Solution' and 'Rebuild Solution' (both in the 'Build' menu) to see if VS can automatically detect and fix this for you.
If that doesn't work, make sure your pages are set as partial classes e.g. public partial class MyPage : Page
If you still have no luck, manually delete the 'obj' folder in your project's root folder, then rebuild again.
Simple trick:
Just edit your Xaml code..(Put space also enough..But need editing)
After edit the xaml page save project..
Now check error disappears..
In my case this was a result of intermediate build paths being too long for Windows. Moving my solution to just off the drive root C:\dev{solution} in my case solved the problem.
I had this problem because the namespace of my .xaml file did not match the namespace of the .xaml.cs file. Fixing the namespaces so they matched corrected the problem.

User control type not defined

I'm having trouble adding user controls to my project.
I right-click on my project and select Add -> User Control...
I then click Add
I drag a label onto the new user control, and save it.
I build the project, go back to my main form, and drag the control from the Components tab in the Toolbox onto the form.
I see the control, but I get an error:
Type 'crm.UserControl1' is not defined.
If I do this with a blank project, it works. I'm not familiar enough with vb.net or visual studio to understand what's going wrong.
If I double-click the error, it brings me to this line in the generated designer code for the form:
Me.UserControl11 = New crm.UserControl1()
and says that crm.UserControl1 is not defined. If I change it to Global.crm.UserControl1, it works, but obviously this code is overwritten when I fiddle with the designer.
Any ideas, or pointers to get me started in the right direction? Thanks in advance.
My main form had the same name as the root namespace. This is what caused the problem.
Kind of late to the party with this one but I had this problem and I think that the issue was due to the controls being built in a more recent framework than the one that I was using.
Basically my custom controls were built in 4.7, but my project was being built in 4.5.1
Once I changed the current build so that they both were the same it compiled happily.
As far as I know, it is kind of accessibility issue because you are able to solve the issue when you try to access the object globally. I think when you drag and drop the control, the definition codes of the control in the designer class automatically generated with private accessibility but I don't know why. You could try to change it as public. I hope this will work.
Way late to this party. I fixed it by referencing it in the aspx page with the following as it was missing.
<%# Register Src="~/Controls/mycontrolname.ascx" TagPrefix="ucControl" TagName="MyControl" %>

Cant add using Telerik.UI.Xaml.Controls.Grid namespace

I am trying to use the Telerik RadDataGrid in my project. For starting off I have just copied the code given the "Telerik Controls Example" app. But when I try adding the namespace "using Telerik.UI.Xaml.Controls.Grid" I get an error
"The name "RadDataGrid" does not exist in the namespace "using:Telerik.UI.Xaml.Controls.Grid".
I have been able to use the RadCustomHubTile easily till now but RadDataGrid is giving me problems. RadDataGrid does not appear in the toolbox also.
I have added Rad Controls for Windows 8 in the reference section.
I am using C#, xaml, visual studio 2012 and trying to build a windows 8 app.
Any help would be appreciated.
Thanx :)
For those who do not know the answer here it is.
Just add this namespace: xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
And in no time you can be using <telerik:RadGridView />!!!!

Intellisense not working for XAML in VS2012 and only partially in Blend

I'm trying to get RC of Visual Studio 2012 working for XAML files. I can't seem to get any XAML Intellisense and the option within Tools is greyed out.
I've also tried to run the solution using Blend, however I only get Intellisense for custom controls such as telerik then.
When ever I drag controls onto the design surface I get an "Object reference not set to an instance of an object" exception but the control is still added to the surface.
I've read that this was a bug within VS11 and was fixed with in the Visual Studio 2012 RC.
I've created a new Silverlight Application and the intellisense is working so i'm wondering if its an issue with how my projects are set up.
I have all of my Styles within a separate themes project, which is referenced by other all other projects. Within the designer these references show up as errors but when the application runs they are resolved fine.
Would unresolved resources at design time affect Intellisense?
Click "Build -> Clean Solution", then "Build -> Build Solution". ("Rebuild Solution" alone doesn't work.) [Source]
If you have a reference to any of the expression blend dlls for interactions and you are using silverlight5 you will need to update the following dlls:
Microsoft.Expression.Controls.dll
Microsoft.Expression.Effects.dll
Microsoft.Expression.Interactions.dll
System.Windows.Interactivity.dll
Blend + SketchFlow Preview for Microsoft Visual Studio 2012
http://www.microsoft.com/en-us/download/details.aspx?id=30702
Ref Location:
C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v5.0\Libraries
Exact same problem here, using WPF.
In my case, removing:
<Page.Resources>
<vm:AnyViewModel x:Key="anyViewModel" />
</Page.Resources>
Solve my problem...
One known cause of XAML Intellisense failure is if System.Windows.Controls.Toolkit is one of the project references. I've seen where deleting that reference instantly fixes the problem. The problem is described in the comments of this Connect bug for VS2012 Beta, but it applies to the RC with the July update as well.
I've found that some xaml designers for a control have this issue, where other controls are just fine.
The problem (in my case) seems to be if parameters are null or events call uninitialized singletons. Something the designer gives you a stack trace and other timers renders with no problem.
I've found by changing the back-end code for pages that don't have Intelli-sense to include DesignerProperties always fixes the issue (in my cases).
public Homing()
{
InitializeComponent();
if (DesignerProperties.GetIsInDesignMode(this))
return;
// some other code here that may have uninitialized members
}
t
I'm not sure if I had the same problem, but Intellisense mysteriously stopped working for me within a XAML file. I tried cleaning the build as someone suggested, but that didn't work.
After I restarted Visual Studio 2013, the Intellisense in the XAML page started to work again.