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 a problem while executing lsgen.exe for generations the .cs files. for information I use the last stable version of lightspeed on a 32-bit windows XP. I've created my database model with PowerDesigner and use the initialization script generated by the same tool for creating my tables in PostreSQL 8. When I try the following command :
lsgen.exe /p:PostgreSql8 /l:cs /c:"host=localhost;port=5432;database=OGST;user id=postgres;password=foobar" /n:OGST.Core /o:"C:\Temp" /linq /m:OGST Some files are generated but the program threw me thee following exception:
No source name specified in relationship from Projectbatch to Project Failed: Invocation of method 'CamelCaseSource' in Mindscape.LightSpeed.Generator.Generation.NameBuilder threw exception System.ArgumentOutOfRangeException : L'index et la longueur doivent faire référence à un emplacement situé dans la chaîne. Nom du paramètre (it means: name of the parameter): length (MethodInvocationException) Could you help me on this ?
|
|
|
This sounds like we may have a problem with the foreign key name. Could you post the CREATE TABLE statements for the Project and ProjectBatch statements, including any primary and foreign keys on those tables, so we can try to track this down for you? Thanks! |
|
|
I've searched in my init script, I've put what I found here => http://pastebin.com/ghtcUvTd It would be easier with syntax highlighting :) |
|
|
The problem is the association to a composite key. Unfortunately lsgen.exe does not yet support composite foreign keys. I will log a bug for this -- at the very least we should emit a warning rather than just blowing up, which would at least allow you to deal with the problem via a partial class. As an alternative, if you are using Visual Studio, you could use the visual designer. This supports an "Update From Source" command which allows you to update the visual model from your database: it doesn't ensure automatic sync like running lsgen as part of a build script does, but it does mean you can fix up the association once and for all in the .lsmodel file, and then just keep syncing. |
|
|
Thanks for the answer :) As I use Visual Studio, I will try to fix the problem with the visual designer. |
|