Hey @mh and all others as well
Marc asked me to post my mail to him, because of a better follow up.
So here is question/answer in one thread:
First, your have been right with your latest mail, when I include the complete XML file structure of an existing project (and just let the empty groups), then it seems to work (first of all)
I saw a few things, which let me think about this project…
- When I run the Save routine, then in the corresponding path isn’t anything written.
hmm. I’ll check. Pretty sure tis has to be working, coz VS and Water use this too…
Have you tried passing true to the force parameter?
project.Save(true);
–No not yet…
- There are a couple of pre-information’s, I would have to define, like the include or the path or even the files.
This will be a really hard challenge at all…
Let me explain, how it works with the MS tool.
First I have to create the project with the CLI, which is in my case as simple as:
“dotnet new classlib -o “ProjectPath” -f “netstandard2.0” -lang “VB” –force”
Sure, thats just as simple as setting the targetframework (as I showed on talk), with a single one of code. “Language” is irrelevant, as elements detects that from the file extension and c an mix them. So the above is really just two lines of code, now.
What does -force do?
–force
Forces content to be generated even if it would change existing files. This is required when the template chosen would override existing files in the output directory.
With this command, the complete structure is build.
After that, all files, which I create and end with the suffix “.vb” will get recognized on the build, so I don’t have to tell the compiler, which file I would like to include (expecting embedded resource files)
When I look into the XML File “xxx.elements” then I see, that every single class and also file has to be included there. So this will be a massive effort, even because I would have to generate all files first and then create the project (if this would work, because with dotnet it would not work, because everything gets deleted and refreshed)
You can also add “.pas”, say, as a single include. Or “folder*” for recursively all files in that folder.