Unable to drag BO's to forms


Author
Message
Daniel Essin
Daniel Essin
StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)
Group: Forum Members
Posts: 235, Visits: 309
Here's the background. I created a BO library with 5 classes and mapped them successfully to the database. The library compiles without errors.



I then created a new StrataFrame Windows App, set the form to be an MdiContainer and dropped a few controls on it. I then tried to drag one of my BO's (which appeared in the toolbox) on to the form and got the exception in the attached screenshot - 'Failed to create component MyComponent'.



I have attached the project.



I know that you're all busy so I will work on something else while I wait for a response and guidance on how to achieve resolution.



Thank you
Attachments
BO Error.jpg (107 views, 104.00 KB)
BusinessObjectLibrary.zip (104 views, 766.00 KB)
DMSF.App.zip (123 views, 18.00 KB)
StrataFrame Team
S
StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Daniel,

Sorry about this post... didn't realize it was out here hanging.

We get this same error all the time.  It generally requires that you restart Visual Studio.  The business objects are added to the toolbox dynamically by Visual Studio and it creates new instances through the Designer.CreateComponent() method to add the instances to the form.  We're not in control of the object creation process.  You'll notice that when you get that error, it removes the business object from the toolbox, and when you rebuild the project, it gets added back to the toolbox, but you still cannot drop one on the form. 

Restart Visual Studio and it should work fine.  It has something to do with the way that the AppDomain is hanging on to the old assembly and occurs more often when the assembly containing the business objects is added to the GAC.

Daniel Essin
Daniel Essin
StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)
Group: Forum Members
Posts: 235, Visits: 309
On the basis of your response, which is very helpful, I have a suggestion.



Why not have a version of the mapper that would run standalone, propmt for the name of the class to create, the directory to drop the class file in, and perhaps the library project that it should become part of.



I could then do my mapping, the mapper could then generate complete classes (without having to go through that manual step of creating an empty class for each bo), add the classes to the project and recompile the project.



Then when I open VS, everything would be ready to go.



This approach would be consistent with the DDT which is already a standalone.



What do you think?
StrataFrame Team
S
StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)StrataFrame Developer (4.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
We thought about going with a standalone version of the BOMapper, but we decided to make it a VS addin because of source control.  We use the EnvDTE.EditPoint interface to modify the text within the files of the solution.  If we modify the raw files on disk and you're using source control, 1) they will be readonly 2) the changes will not be incorporated into source control 3) the files will not be checked out before they are modified.

Those are the problems we ran into... Ermm

Daniel Essin
Daniel Essin
StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)
Group: Forum Members
Posts: 235, Visits: 309
I'm not sure that applies to Subversion, if you have done a "checkout" and had the mapper update the files in the working directory.



Anyway for those of who don't use version control, the current behavior is a negative, not a plus. Even on my dual-core AMD 4800+ with 2 gig ram, it takes VS a painfully long time to close and reload.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
We use Team Foundation and we do not have this issue at all (as it relates to speed)...Visual Studio opens and closes quickly.  It was slow when we used Source Safe in the early days, but since we moved to Team Foundation we have not had this issue.  Team Foundation is a wonderful tool and I highly recommend it to anyone working in Visual Studio over any other source control tool.
Daniel Essin
Daniel Essin
StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)
Group: Forum Members
Posts: 235, Visits: 309
noted. thanks
Daniel Essin
Daniel Essin
StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)
Group: Forum Members
Posts: 235, Visits: 309
The problem that stopped me a week ago was an exception that was thrown when I tried to drag a bo onto my main form.



Based on your comment, I assumed that if I reopened VS today, that everything should work right. When I reopened the project, the main form refused to display in the designer. Since it didn't have much content, I deleted it and created a new SF Main Form. This also refuses to display in the designer until I close VS and reopen it. What's going on? This is a mess.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
My comment had nothing to do with the problem you just posted.  The reason you are getting an error has nothing to do with StrataFrame or your source control program.  You are getting an error because .NET cannot properly create an instance of your form.  There is an error in your form when it attempts to open in the designer.  What is the message you are getting?
Daniel Essin
Daniel Essin
StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)StrataFrame User (261 reputation)
Group: Forum Members
Posts: 235, Visits: 309
I can't get the error now because it did not recur when I closed and reopened VS. My recollection is that is was the same type of error that I got when I tried to drage the bo onto the form a week ago.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search