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 guys, As far as I recall, LightSpeed generates Dtos automatically when System.ServiceModel is referenced. Would it be possible to add a mechanism enabling "on-demand" Dto generation ? This could be done either as a #define GenerateDtoOnDemand or perhaps as a designer feature?
|
|
|
Hi there, Is your requirement to turn *off* DTO generation in a project that references System.ServiceModel, or to turn *on* DTO generation in a project that does *not* reference System.ServiceModel? We already have a hidden setting for the former, which I can post if it's what you need. If it's the latter, could you say what your use case is? There are some attributes on the DTOs that depend on the WCF DLLs, so I'm a bit doubtful about generating them when the WCF DLLs aren't referenced... |
|
|
I'm looking to turn it on, it didn't kick in automatically for me - for some reason |
|
|
Hmm, in that case I'd prefer to try to fix the problem of why it isn't kicking in automatically. Can you share your .csproj file and .lsmodel with us? In the meantime, since you'll need a way to keep going while we investigate, you can force LightSpeed to generate DTOs by editing the code generation templates. Go into Base.vm, and look for the following lines near the end: #if ($Context.IncludeDataContracts) Delete or comment out the #if and #end lines. (The comment character in the template language is ## -- e.g. ## #if....) |
|
|
Ah, I've just been told that you're using the LightSpeed 4 beta. This doesn't currently generate DTOs -- it assumes you'll be using entities directly using the new entity serialisation support. If you need to generate DTOs, you can revert to LightSpeed 3.11, or I am told that you should be able to edit the template to re-enable DTOs (add the #parse("DataContracts.vm") line into Base.vm just before the closing brace of the namespace). |
|
|
You may need to take a copy of DataContracts.vm from a LightSpeed 3.11 installation. |
|