Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSharp projects are removed from the solution when building from the engine #2417

Open
fswadling opened this issue Aug 18, 2024 · 13 comments
Open
Labels
bug Something isn't working

Comments

@fswadling
Copy link

Release Type: Official Release/GitHub (please choose appropriate option)

Version: 4.2

Platform(s): Windows

Describe the bug
Running build from the editor is removing my fsharp projects from the .net solution.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new stride project.
  2. Add an fsharp project to the solution in visual studio
  3. Run build from the game editor.
  4. Return to visual studio. The fsharp project is unloaded.

Expected behavior
Leave fsharp and vb.net projects alone.

Screenshots
If applicable, add screenshots to help explain your problem (use GitHub drag & drop)

Log and callstacks
If any, please attach here any log or callstack (preferably in a .txt file using GitHub drag and drop)

Additional context
I'm not expecting extensive fsharp support anytime soon, but fsharp is a part of .net and I don't see why stride should be outright hostile to using it in the codebase.

@fswadling fswadling added the bug Something isn't working label Aug 18, 2024
@Doprez
Copy link
Contributor

Doprez commented Aug 18, 2024

This is not exclusive to F# AFAIK. I have had this happen for C# projects as well when I use VS to add them to the solution.

The work around for C# is to close all editors (VS/Rider and GameStudio) after adding a project and then reopen and it will update GameStudios references. That at least works for C# but I have not tried with F# or VB so it may not be the same if that doesn't work.

You may also be able to add the project reference through the GameStudio UI and try?
image

@fswadling
Copy link
Author

fswadling commented Aug 18, 2024

@Doprez Closing and reloading everything seems to have done the trick. Strange because The fsharp project did appear loaded in gameeditor.. Well whatever. In any case adding an existing project via gameeditor isn't possible currently as it seems only csproj files are supported.

Thanks!

@fswadling
Copy link
Author

@Doprez Wait no, the issue is still there, the fsharp project gets unloaded when i add a script (to a csharp project) and return to visual studio.

@VaclavElias
Copy link
Contributor

We were doing some updates in the engine so F# can be run in code-only. I recall, there is a PR #1078, which was closed, because the original author didn't finalise it, which was doing some additional updates so it could work also with the Stride Studio editor.

@fswadling
Copy link
Author

For the record I can live without fsharp integration in gameeditor, it would just be nice for gameeditor not to unload additional fsharp projects in my solution.

@Doprez
Copy link
Contributor

Doprez commented Aug 19, 2024

@IXLLEGACYIXL Would you have any input on this issue? I know you at least messed around before with fixing some of the multi project issues before. I dont know why GameStudio would actually remove things from the solution so maybe its as simple as removing something from the project loader? or maybe I'm way off lol.

@VaclavElias
Copy link
Contributor

If you check the mentioned PR, there are some checks for csproj and cs. But I don't know which are build/editor related..

@IXLLEGACYIXL
Copy link
Collaborator

@IXLLEGACYIXL Would you have any input on this issue? I know you at least messed around before with fixing some of the multi project issues before. I dont know why GameStudio would actually remove things from the solution so maybe its as simple as removing something from the project loader? or maybe I'm way off lol.

i know that projectwatcher currently only works with c#
the loaded assemblies would have to be considered first so the project watcher can even look at it and then the projectwatcher needs to be expanded

it shouldnt "remove" anything.. it just strictly ignores it XD

@fswadling
Copy link
Author

To clarify; It doesn't remove it from the solution, it just unloads it. I can reload it by right clicking on the unloaded fsharp project and pressing reload. Its just a bit annoying

@IXLLEGACYIXL
Copy link
Collaborator

To clarify; It doesn't remove it from the solution, it just unloads it. I can reload it by right clicking on the unloaded fsharp project and pressing reload. Its just a bit annoying

then the reload is just not triggered https://github.com/stride3d/stride/blob/master/sources/editor/Stride.Assets.Presentation/AssetEditors/ProjectWatcher.cs#L240-L246

@IXLLEGACYIXL
Copy link
Collaborator

@Kryptos-FR
Copy link
Member

One thing to consider is a buggy behavior by Visual Studio: when a project is added to the solution (or removed from it), the .sln file isn't updated until after it is manually save (with Save All) or automatically saved when building the solution. Therefore, external tools (such as the GameStudio) won't be notified until afterwards.

This has caused issues in other context (unrelated to Stride) where people would commit new code without the changes on the .sln file. Despite haven been notified to Microsoft for more than a decade, it has never been fixed.

@VaclavElias
Copy link
Contributor

One thing to consider is a buggy behavior by Visual Studio: when a project is added to the solution (or removed from it), the

Probably, it would be nice to have here https://doc.stride3d.net/latest/en/manual/game-studio/index.html, under Game Studio a new page, maybe titled "Working with Visual Studio" or something better.

Where we would add some basic instructions regarding working with the C# projects in Game Studio and Visual Studio, emphaszing to use Save All before commits + some other tips and recommendations?

If you could draft for me the content, I would be happy to finalise it and add it to our Manual 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants