This is very strange. I have a custom UserControl called UIControl. That user control has another custom control (derived from Label control).
This worked OK for long time. Both at design time and at run time. However, now, I needed to edit that custom UIControl but the Visual Studio 2019 shows this error message:
This error means that the RealTime.DigitalClock is not found. As you see in the project, that control is not part of an external assembly, but the same assembly where UIControl is.
I have compiled and recompiled thousand of times and compilations finish perfectly. Even the application runs.
Furthermore, when I build the project, those user controls appear in tool box, but when I try to place it in any form, an error telling that the component could not be added and it will be removed from the tool box is shown.
I don't really know what is happening here. I have even closed and re-open VS 2019 but no avail.
Regards
Jaime
According to To prevent possible data loss in windows form c#, I suggest that you can do as the following steps.
First, Please find all the RealTime.DigitalClock related code in UIControl.designer and UIControl.cs.
Second, you can delete the above code.
Third, you need to rewrite the code you just deleted.
Finally, rebuild it and check if it works for you.
So I want to start doing c# from head first c# 3rd edition, the big problem is that I can't find neither blank page and I saw alot of people saying that using WPF is okay, but when I try and add a new item I see nothing related to c# or what I actually need, what I need is a basic page, here is how it looks like:
now the problem is I can't fix it to show me what I need only for c# I tried, community,enterprise.
Does anyone have any idea of how to fix this?
You seem to be trying to add an item at the solution level. Note that in the screenshot it says "Add New Item - Solution Items". This will create files that exist in the solution, but no belong to any particular project, not affecting the output of compilation of any project. That's the reason why you don't see anything code related, you're not editing a code project.
Instead, right click on the project item on the solution explorer (not on the top solution item) and add a new item there. The selection of options will be specific to the type of code there. For example for WPF you'll get all XAML-based file types, or for Winforms you'll see forms and control classes.
I had this same problem I am using Visual studio 2015 community edition, the problem is you have created the wrong project to start of with. The screenshots in the book are from VS 2013 so it will look a little different.You need to create a Blank App(Universal windows 8.1) highlighted in the image attached and not Blank App(universal window). Once I done this basic page will no be available in the add new item page.
VS 2015 Screenshot
I apologize for the remedial question. I accidentally closed the tab in Visual Studio that allows me to view the actual application (the one that loads by default when you create a new project). How do I bring this back up?
I've tried closing and re-opening the project, going through solution explorer in its entirety, and scanning every information source I can get my hands on. Thank you for your advice (and patience)!
If you want get the interface, that if you run your application it in a browser. On the panel open your browsers and choice Browse With:
in window choice Internal Web Browser and click Browse
If you want view your build anytime in internal browser - Set as Default.
Sorry for my English.
I'm using Visual Studio 2005 w/.NET 2.0. I have no idea what happened, but all of a sudden I noticed that the Properties window for ALL of the DataGridViews in my project went blank. I've tried dropping in new ones..still blank. I restarted Visual Studio and my computer...still blank. I've done some google searches, and I've found people who have had the same problem, but there is no solution and it appears that Microsoft has been unable to duplicate it. Any ideas?
I created a new project in a new instance of Visual Studio and dropped a DataGridView in there, and it worked..then I checked my other project in the other instance of VS and the Properties can back for my DataGridViews. Fluke or solution? No idea.
I have had similar problems where my property windows go blank. It tends to happen when your machine is using a lot of UI resources or your toolbox is trying to update its list of controls.
Check to see if your control is being selected by your property window at the top of the property window screen
Try switching to a different control and then back to force the property window to update
Just close your UI Designer and re open it.
If all else fails, just close and reopen your solution
If it's still a problem you can always reduce how much memory your toolbox/UI designer uses by removing custom control generation in your toolbox window. To do this go to Tools / Options / Windows Form Designer / AutoToolboxPopulate - set to false. Now this will not populate your toolbox with custom controls anymore from your solution.
This same thing happened to me because the full path of the project contained an '&'. When I moved the project to a path that did not have an '&' everything worked.
There was same problem - reason was '&'.
I had a bunch of similar problems with Visual Studio UI doing wacky things. I figured it had to do with memory consumption (not a lack of machine memory). Jetbrains made a wrapper here that has solved a lot of my problems in Visual Studio 2005.
Ok, so, my visual studio is broken. I say this NOT prematurely, as it was my first response to see where I had messed up in my code. When I add controls to the page I can't reference all of them in the code behind. Some of them I can, it seems that the first few I put on a page work, then it just stops.
I first thought it may be the type of control as initially I was trying to reference a repeater inside an update panel. I know I am correctly referencing the code behind in my aspx page. But just in case it was a screw up on my part I started to recreate the page from scratch and this time got a few more controls down before VS stopped recognizing my controls.
After creating my page twice and getting stuck I thought maybe it was still the type of controls. I created a new page and just threw some labels on it. No dice, build fails when referencing the control from the code behind.
In a possibly unrelated note when I switch to the dreaded "design" mode of the aspx pages VS 2008 errors out and restarts.
I have already put a trouble ticket in to Microsoft. I uninstalled all add-ins, I reinstalled visual studio.
Anyone that wants to see my code just ask, but I am using the straight WYSIWYG visual studio "new aspx page" nothing fancy.
I doubt anyone has run into this, but have you?
Has anyone had success trouble shooting these things with Microsoft? Any way to expedite this ticket without paying??? I have been talking to a rep from Microsoft for days with no luck yet and I am dead in the water.
Jon Limjap: I edited the title to both make it clear and descriptive and make sure that nobody sees it as offensive. "Foo-barred" doesn't exactly constitute a proper question title, although your question is clearly a valid one.
The above fix (deleting the temp files) did not work for me. I had to delete the PageName.aspx.designer.cs file, then right-click my page, and choose "Convert to Web Application" from the context menu.
When Visual Studio attempted to rebuild the designer file, it encountered (and revealed to me) the source of the problem. In my case, VS had lost a reference to a DLL needed by one of the controls on my page, so I had to clean out the generated bin folders in my project.
try clearing your local VS cache. find your project and delete the folder. the folder is created by VS for what reason I honestly don't understand. but I've had several occasions where clearing it and doing a re-build fixes things... hope this is all that you need as well.
here
%Temp%\VWDWebCache
and possibly here
%LocalAppData%\Microsoft\WebsiteCache
Is the control that you are trying to reference inside of the repeater?
If so then you need to look them up using the FindControl method.
For example for:
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server">stest</asp:LinkButton>
</ItemTemplate>
</asp:Repeater>
You would need to do this to reference it:
LinkButton lb = Repeater1.FindControl("LinkButton1");
In my case, I was working with some old web site code, which I converted to a VS2008 solution. I encountered this same problem.
For me, the fix was to right-click the Web Sites project in the Solution Explorer and select Convert to Web Application. This created designer.cs files for all pages, which did not yet have these files before.
you will also find .net temp files which are safe to delete here:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
I observed this happens because of missing .designer.cs file. Following fixed this issue in my case (basically I had these files copied from VS 2005 web project to VS 2010 project): Right Click on .aspx file and select menu "Convert to Web site", this will create .designer.cs file and then it should work file.
In my case new asp controls I added to an existing were not being detected.
What worked for me was forcing a recompile by renaming an existing control to break the build eg: changing <asp:TextBox ID="txtTitle" runat="server" /> to <asp:TextBox ID="txtTitle2" runat="server" />
When I corrected the ID and rebuilt a new designer file was generated with the corrected ID and new controls.
right click on project name and select "Clean". then, check your bin folder if it has any dll remaining. if so, delete it. that´s it. just rebuild and every thing will work fine.
This can also happen if the Inherits property on the source page doesn't match the class name in the code behind. Generally speaking, this would probably only happen if you copy/pasted a .ascx/.aspx file and forgot to update it.
Example:
<%# Control AutoEventWireup="false" CodeBehind="myControl.ascx.vb" Inherits="myProject.myWrongControl" %>
The the code behind class:
Partial Public Class myControl
we cannot change the code when the application is running .To do so first click on the stop button on the top which will halt your application .now click on the button in design mode ,it will insert the code in .aspx.cs file ,then write the code in it
Check out your aspx file on errors, once I've faced with that problem
I had this happen a few times and it happened again today for a new reason. I normally run my project through IIS but needed to run it locally to debug. I normally run on port 80 in IIS and 81 in debug, but I had some settings in the web.config that used 80 so I just killed the site in IIS and switched the website to port 80 in the project settings. For whatever reason, this messed everything up and created the problem described in the OP. I started trying things one by one, including all the advice mentioned here, but switching the port back to 81 in the project settings is what ended up working.
For me, deleting/renaming the files in the following location worked:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myvirtualwebsite\e331e0a9
Just to add my two cents with this problem.
The only thing from all the above that worked for me was the "Clean" and then delete anything left in the bin folder. Rebuild and all controls started working then.
FYI...I was having this problem too and I ended up fixing it by deleting the existing .designer.vb file, right-clicking on the project and choosing Convert to Web Application. It then showed the real "error" that was causing the GUI to crap itself. Turned out I had used the same name for 2 other labels but that wasn't being shown in the error list window. Once I renamed one of the 2 other labels it built fine and stopped giving me trouble.
You have to add
runat="server"
to each element in your page.