Opening existing project in Delphi 10.2 reports error that "Class TBarSeries not found." - teechart

This is a strange one, and is related to the Delphi IDE environment, but I'm hoping someone has some insight, cos I'm at a loss.
Basically, the problem is that I'm now in a situation where any project I create that uses a TChart with a TBarSeries gives me the "Class TBarServices not found" error when I re-open it from a fresh start of the IDE.
As an example, currently if I do the following:
Create a new VCL forms application,
add a TChart component to the form,
edit the chart through the designer and add a Series, choosing Bar as the type.
Build the project,
run it, everything is fine.
Close the IDE and restart it.
Open the previously saved project. Immediately get the Error Reading Form message about Class TBarSeries not found.
But if I then:
Close the broken project without saving, and leave the IDE running.
Create a new VCL form with or without a project,
add the TChart and bar Series to the form,
close the form/application without saving.
Reopen the previously saved project that threw the error. No error any more.
Creating a new TForm with a TChart and TBarSeries is changing the Delphi IDE in some way that is not persistent, so that the next time the IDE is started, those projects no longer load properly.
I have included VCLTee in the Unit Scope Names, but the Enterprise version of Delphi 10.2 does not include the source for these components, so there are no additional paths I can add to the Library Path.
Once I have created a new form and set up the chart, everything is fine with any project that uses the TBarSeries so long as I don't close the IDE, so that's the workaround I currently employ.

Do you use DevExpress?
I had the same problem when DevExpress Printing System for DBTeeChart was installed.
Probably DevExpress uses old version of TeeChart different than this installed by you.
I just disabled this DevExpress Printing System and now it's OK.

Related

vb6 ocx project - can run EXE directly, not in debugger

I have a VB6 ActiveX control project (creating an .OCX), which has several User Controls. The controls are being loaded by an EXE (also VB6). When I run the EXE directly, it runs OK, but when I try to run it in the debugger (I need to step through the code), it cant't load the user controls (.ctl), gives me "Class not registered. Looking for object with CLSID:..." message
I have the Binary Compatibility set (kept all the old GUIDs), and I see the classes in the registry, everything looks OK - just doesn't run in debugger.
Any help please?
I've been working with VB6 for over a decade now. The problem is that the VBP project reference is out of sync with the latest build of your OCX user control. Simply open the project as a group or the EXE project on it's own and click Project->Components.
You will now see one of two things. Either the reference will be invalid or you have a valid reference chosen. Either way, uncheck the reference and click okay (do not re-select it during this operation.. trust me). Now, close that dialog and go back into Projects->Components, now pick your OCX control from the list. This will solve your problem. If your OCX is not in the list than rebuild it independently first and try again.
This is an undocumented bug with the VB6 IDE. Even with VB6 SP6 it had not been solved.

Visual Studio Converted Project User Control Designer File Incorrect

I have an ASP.Net project that I converted to C# from VB using InstantC#. The conversion appears to have happened pretty well. Only a few items had to be fixed manually. I did this after converting the project from VS2010 to VS2012. Once I fixed the inferred method and object references, I was able to build once.
Upon viewing the page, I received an Object Null Reference Exception on an event handler assignment.
I built again. This time, I received all kinds of errors from the methods and properties for code that referred to other user controls that the page has on it. In looking at the designer file, it is not correctly determining and assigning the types to the controls.
I have tried manually changing the object types, but Visual Studio changes them back.
I have also tried deleting the designer file and choosing Convert to Web Application.
There are other user controls in the same project that work fine. No issues. Any other ideas on how to fix this?
I finally fixed this by creating a brand new user control, and then pasting the UI from the original user control. Once I confirmed the designer file was generated correctly, I imported the code behind from the original user control.
To be sure everything went as planned, I renamed and excluded the original user control from the project and tested the new one. When I confirmed that things were working, I deleted the original.

Workflow Foundation: Designer is not working

When I try to open any activity in design mode designer fails with message "The document contains errors that must be fixed before the designer can be loaded. Reload the designer after you have fixed the errors". The project builds and runs fine though. This happens even with a fresh newly created solution. I mean that if I create a new workflow project and add a new item -> activity the problem persists.
If I click "Reload the designer" I get the following error: "Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'System' that is not included in the assembly". If I build the project the error disappears but the designer doesn't start working.
I'm using VS2010 Premium. The only plugin installed is ReSharper. However I tried removing it but it didn't solve the problem. I've also asked a friend of mine to reproduce the same error on his computer but everything worked well.
The problem was that there are several types of editor for .xaml files. If you right click open with you can choose one of them. In my case WPF designer was selected by default though it's better to choose automatic selection.
Hope this information will be helpful for someone else :)

Visual Studio 2010 Designer Bug: Unable to copy from obj\debug to bin\debug

Wondering if anyone has a solution to this 2010 bug. I have a project that built fine in Visual Studio 2008 that wont build in 2010 because Visual Studio is holding on to the dll after the application is run ONLY if a designer window is open. I created a really light weight project that shows this problem. If you create an application then create a lib dll. Put one form in the dll, open the form in design view and then run the application. It will run fine, then close the app, go to the code view of the form in design view, and change the code ( I just renamed a single variable) then try to recompile you get the following:
Error 1 Unable to copy file "obj\Debug\customlib.dll" to "build\debug\customlib.dll". The process cannot access the file 'build\debug\Customlib.dll' because it is being used by another process.
If you run Process Explorer and search for the dll, the only process holding the dll is devenv.exe!!!
I have done a ton of searching on this problem and have found similar issues with older versions of Dev Studio where people were able to just add a pre-step to move the locked dll to another name (.locked) and build. Well that works the first time, but the next time you run then edit you are locked out of both the current dll and the one you moved to .locked, so unless I am willing to add code to randomly generate a name for the locked dll, this wont work for me (I don't want my debug directory size to grow with files never getting deleted.)
I have only found one workaround and if you are in this same boat this is what I have to do to edit and run. I make sure EVERY design view window is closed BEFORE I ever run my project in the debugger. If you close all the open design view windows devenv.exe will not hold the dll.
Does anyone have a better solution to this problem?
I'm not sure whether this will work for you or not, but this similar question if you have this line in AssemblyInfo.cs:
[assembly: AssemblyVersion("2.0.*")]
changing it to:
[assembly: AssemblyVersion("2.0.0.0")]
will solve this isue.
The Visual Studio add-on "VSCommands" claims to have a fix for this problem. I've not tested it yet, but it also claims to have an in-IDE stackoverflow reputation tracker which intrigues me :)
Your "Close designer before debugging" workaround seems to be working for me (so far), for which I'm very grateful. It was beginning to get to the stage where am large part of my day was spent in the following workflow...
F5
loud expletive
ALT F4
WIN 3
waits impatiently...
F5
I have had the same problems for a long time and then suddenly they disappeared. I realized that the source of the problems was initializing code in the constructors of WCF services and WPF controls. After cleaning the constructors from any dependencies to other assemblies everything has been fine.
So my suggestion is: Clean your constructors.
In WPF it is possible that inserting:
if (DesignerProperties.GetIsInDesignMode(this)) return;
or similar will have the same effect.

generation of designer file failed

Every few days VS2008 decides to get mad at me and fails to generate a designer file claiming it cannot find the file specified and that it's missing an assembly. Here's the scenario:
The aspx page has a reference to a custom user control (inheriting UserControl) which references another assembly in the backend. There are many other references to this "missing" assembly in other places in code which don't throw errors. rebuilding, updating the source to the clean copy, shouting at the computer, punching the screen, etc all fail to work.
Any suggestions? This is quite annoying.
We've had similar problems before, unfortunately I don't remember the exact solution.
If your using a "Web Site" project (no project file) then start by checking that both your page and your control both set the ClassName property in the first line of your aspx/ascx file and that you specify the full name of the class including the namespace.
Example:
<#Control Language="VB" AutoEventWireup="false"
ClassName="YourProjectName.YourUserControl"
Inherits="YourProjectName.YourUserControl"
CodeFile="YourUserControl.ascx.vb"
%>
Many times not setting all of these will still work but you will get odd compiler errors and behavior in VS.
If you using a Web Site Application project try deleting the designer file manually and then right click on your project and choose "Convert from Web Application." This will should recreate the designer file for you.
My only other suggestion would be to recreate the page and/or the user control from scratch.
Jared, you've hit it. Using "Convert to Web Application" to manually generate the designer file solves my problem. I'm glad you posted this before i started reinstalling. Thanks.
You might try archiving a template of a new file with its designer equivalent. If VS coughs then you can do an "Add Existing" option with the file you already have.
It seems, however, to be an issue with your installation of VS2008 so you might try reinstalling it.
I found that using a custom control, you would need to add a reference to the .dll. This fixed it for me after migrating from a web site to web app.

Resources