This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi! I've encountered an odd issue with lightspeed when attempting to create a partial class (so that I can add a new readonly property) 1) Right Click on the entity in the designer 2) Select "Refactor" -> "Create Partial Class" 3) Select the location for the class 4) Get the following message: "There is no generated class for [redacted]. Creating a partial class requires a generated class." How do I force a class to be generated? I thought classes were always generated upon save? I'm using Visual Studio 2008, and using the December 10th Nightly. -Soen |
|
|
Hi Soen, That does sound odd and yes the code generation occurs on save. If you expand the node next to your .lsmodel file you should see a .cs or .vb file and a .diagram file as sub project items for the model. If you open up the code file can you check that your class has been generated?
|
|
|
Hi Jeremy- In the solution explorer, the diagram isn't a node - It's just the diagram, and I can't see the codebehind. I've tried manually adding the .vb and .diagram files to the solution, but they don't show up oddly. I even deleted and reconstructed the lsmodel from the database and still no codebehind file, which is odd, but the file is definitely in the project's physical directory and is up to date, and the compiler/linker doesn't have a problem including it. I'm guessing because I can't see the .vb file in the solution, neither can lightspeed therefore it doesn't think it exists? -Soen |
|
|
Perhaps some further information is useful- The LS diagram is shared (using vs.net's file linking feature) between a vb project and a c# project, and was originally sourced from a different project with a different namespace. I find that changing the namespace is sometimes flaky, needing to rename and then rename it back sometimes. Maybe there's something in there that you wouldn't recommend? -Soen |
|
|
If I am understanding you correctly you have included the code generated file directly in your project structure and it does not reside as a sub-item underneath the .lsmodel file and that (both?) files are included via the "Add File as Link"? e.g. vs. LightSpeed is expecting the generated source file to be a sub-item (which still works fine with models added via a link) and the lack of this will trigger the error you are seeing. So to switch between the two, remove the manually added source version from your project and then re-save the model which will trigger a code generation and add the generated file as a sub-item. Let me know if I have misunderstood anything and this doesnt reflect your setup though!
|
|
|
Thanks Jeremy! That's resolved it. Although I can't see the subitem, but it's fixed my issue with creating partial classes. I guess the subitem is being "hidden" courtesy of VB.net attempting to dumb down the solution explorer - I've seen this many other types of files. Thanks for your help! Soen |
|