When source files are added as Links, they instead get added as actual, relative file references.
Steps to reproduce:
Create Silverlight project1 (no web site needed).
Create Silverlight project2 (no web site needed).
Add class file to project1’s root folder.
Create a New Folder in project2.
Do Add|Existing Item
Select the project1 class file. (don’t press enter).
Click on the Add split button arrow.
Choose "Add As Link".
Instead of a link (with shortcut icon), a relative file reference is created. Such as "…\class1.pas".
It should be a shortcut instead.
If you do the same steps in a C# project, you will see how it SHOULD be done.
Workaround:
The relative file reference WILL compile and allow the two projects to share the same source.
However, if you delete the folder in project2, instead of deleting the folder and its content (a link), it will delete the folder AND the file from project1.
If it were a shortcut (as with C#), deleting the folder and its contents ONLY deletes the folder and the shortcut, not the file in project1.
Hopefully you guys can get it to work like the C# projects do. I have wanted to use this link in a folder a couple of times and each time, I had some problem or other and decided to just delete the folder. And LOST the files that the “link” was pointing to.
I would really like organizing links in a folder in order to share code between projects.
It’s currently working as designed. That said, I’ve logged issues to both fix the deletion problem as well as to allow linked files to be in subfolders. These won’t make it into our January release, but should be in a beta release shortly thereafter.
marc hoffman says when he tries to create a link in C#, it doesn’t do it. Are YOU able to do it with your VS and C# with a Silverlight app? I am using VS 2010 Professional SP1Rel and SL 5 (though the SL version doesn’t seem to make a difference because I tried it in 4 and it still worked in C#)
As far as I know, I don’t have anything special set up with my version of VS like 3rd party products or anything that might be making it work.
I found out that the C# project ends up with something like:
currently, Oxygene doesn’t recognize the tags… external files always end up in the root. they may show in the folder when initially added, but when you reload the project they won’t be where you expect.
this is one of the issues i’ve logged. the syntax will probably be similar to the C# version.
Hopefully, you have logged not only that the system doesn’t remember where it is supposed to go, but more importantly, that it supports a link as a link, not a file.
This is being handled under the Embarcadero QC issue filed for it. In the future, please don’t file the same issue here and in QC. One or the other is fine… they both get handled the same way on our end.