Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I created a control library with 7 custom properties. I have a test form project in the same solution as the control library project. I can add a control to the test form and it works great. My custom properties are displayed in the properties window when the control is selected. I can change the properties of the control in the properties window fine also.

 

When I reference the control library in another solution, I can add a control from the control library to a form no problem. When I run the program it auto saves, removing the asterick by filename, and then the .vb files (code and form) show the asterick again and the .vb file with the form on it changes to a red x with the following message:

An error occurred while loading the document. Fix the error and then try loading the document again. The error message follows: The designer cannot be modified at this time.

 

Has anyone else experienced this?

rustyd
Posted

Nevermind. I added the control library to the toolbox so my controls would show up there. I made some changes to the control library, removed the controls from the test form and plopped on a new control from the toolbox, which was referencing and older build of the control library. Is this possible? If that's the case, and it avoids DLL hell, does that mean there is a DLL hell2 where you think you're referencing a new build, but instead, the designer is referencing the old build?

 

Anyway, by removing the reference in the toolbox and re-adding from the new build of the control library, everything worked fine.

rustyd
  • *Gurus*
Posted

I've never encountered this behaviour when referencing a control library that's compiled in to a DLL.

 

When I'm developing controls I have one solution with both the control library and a test project, and the designer automatically puts the control library in the toolbox. However, this isn't compiled on disk, instead it's referencing the dynamically compiled version kept in memory by Visual Studio. Occasionally it can forget to update this and I have to close the test project form and re-open it.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

I have a solution with 2 projects, one is the control library and the other is a form that I use to test the controls (sounds like your setup). You're saying your controls from the control library are automatically putting the control library controls on the toolbox? How do you do that?

 

I had to right click the toolbox, click customize toolbox... and click the .Net components, and select my library. I had to do this in the control library solution and the separate solution where I am referencing the control library (so I could just drag and drop the controls onto the form).

 

Whenever I would make a change, the changes wouldn't update the separate solution.

rustyd
  • *Gurus*
Posted

Actually come to think of it, that is what I had to do. I was thinking of testing a control in a form in the same project as the control. I did have to add the control to the toolbox in the test project, from the compiled version.

 

The problem you're having may be because the build order of your projects isn't right. You need to right-click your solution node and choose Project Dependancies. You have to indicate that your test application is dependant on your control library so the control library gets built first.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • 5 weeks later...
Posted
I checked the build order and the component library is built before. My test project has the component library in the Depends On list and is checked. The component library has the test project in the Depends On list and is not checked.
rustyd

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...