dotnet / WatsonWebserver

Watson is the fastest, easiest way to build scalable RESTful web servers and services in C#.
MIT License
411 stars 84 forks source link

Can nativeaot be supported #107

Closed williamlzw closed 1 year ago

williamlzw commented 1 year ago

Q2E 6K V~@DQ{`AHX0_ 9@E

jchristn commented 1 year ago

Please clone the source and make the suggested change discussed on the issue you filed for HttpServerLite: https://github.com/jchristn/HttpServerLite/issues/26

jchristn commented 1 year ago

So it looks like nativeaot cannot be supported in the code as it exists currently. Assembly.GetCallingAssembly() is required in order to load routes from the code using the library. There could certainly be a version of the server that doesn't support static routes, parameter routes, and dynamic routes, however, I don't know if removing those capabilities would necessary mean the library directly supports nativeaot. If you would like to test and let me know, please do.

williamlzw commented 1 year ago

In the near future,. NET 8.0 may support nativeaot compilation reflection methods.