-
Notifications
You must be signed in to change notification settings - Fork 1
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
Default() is not found #46
Comments
Default() in samples is working btw. Issue is only in my own code( I have an assembly definition file if this is important). |
Hello, |
I have yet to repro as I am not currently available. Meanwhile can you include the manualdi assembly as a reference to your custom assembly. |
When selecting which type of Installer to choose, see the following
The classes above are provided for convenience and I don't foresee any real need to have any further custom implementations, but if you happen to find any, feel free to implement your own version. The underlying implementation is really simple. Don't try to Mock or hide the UnityEngine interface. This is more problematic and very complicated to hide. Just keep the unity parts isolated from any pure logic and it usually works great. I like having lots of static utility methods that do the grunt work and then call them from the instances that are bound to the container. |
I recall you mentioned on the previous issue that you are using Unity6 https://docs.unity3d.com/6000.0/Documentation/Manual/create-source-generator.html According to the docs, unity6 is now only compatible with Microsoft.CodeAnalysis.Csharp 4.3 The project is currently using 4.1 up until now unity required 4.1 😅 If I have the time, I'll check tomorrow how I could export a unity package with both DLL and conditionally include one or the other depending on the unity version. |
This makes perfect sense, not sure why I was testing it with pure service😅 |
I tried to get a quick fix up for you and downloaded unity6, but it seems to be working just fine, even with the current 4.1 version. My suggestion, however strange it might seem, is that you restart your computer. It has happened to me while developing the source generator that the dotnet roslyn source generation server background app gets stuck and is unable to properly restart and load new DLLs. If it doesn't work, maybe try to reimport all assets in the project again Let me know how it goes. |
If it still doesn't work after that please link a sample project so I can review it 🙏 |
I tried your suggestions and it didn't worked unfortunately. I tested it in another almost empty 6.0 project and issue was presented there as well. I upgraded that project to 6.1 and it didn't fix it. I then downgraded it to 2022.3 and issue dissapeared. After that I succesfully upgraded it again to 6.0 without any problem. Unfortunately I can't do the same with my main project as it's have many package dependencies and assets (I'm sure uxml assets will be completely broken for example and prob it'll make many more issues). I wll try to reproduce this issue again in empty new project and will send it to you. |
I'll try to create a new empty unity 6 project |
Really sorry, but still could not repro your issue. Best for me to debug would be a minimal project where it is not working 🙏 |
I haven't been able to repro it in empty project too. Seems like it's something with my project. I'll update this thread if I find the root of the issue. Thank you for help. |
Hi again! I'm having an issue with source generated Default() method.
Do I need to configure something for source gen to work?
The text was updated successfully, but these errors were encountered: