-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Equivalent for System.CodeDom configuration element? #1434
Comments
@anurse do you support building an ASP.NET Core app without VB/C#? https://github.com/dotnet/corefx/issues/12180#issuecomment-366542284 tells me that ASP.NET Core does not use CodeDOM at all. @hippiehunter what are you trying to do -- do you have a custom language? Generally we would recommend that new code use Roslyn API's, rather than the very old CodeDOM API which (as you point out) are not as extensible in .NET Core via config files. |
Yeah I have a language. Historically there hasn't been a problem building Controllers, but it seems like Razor has been injected as a non optional part of the build system in 3.0/3.1. There is a carve out in their targets file to prevent this from burning F# specifically, but that doesn't really help me. The task that appears to have a requirement for a CodeDomProvider is WriteCodeFragment and its getting called from Microsoft.NET.Sdk.Razor.MvcApplicationPartsDiscovery.targets and that appears to be brought in by the Microsoft.NET.Sdk.Web sdk. |
Makes sense. The right answer here is likely for them to provide a general non codedom path rather than reinvent config files for this. @anurse can advise. |
ASP.NET Core doesn't use CodeDOM at all AFAIK. And Razor pages always include C# syntax, but should work in a F# project, I believe. cc @rynowak @NTaylorMullen @mkArtakMSFT |
To be clear, I'm not actually trying to do anything with Razor pages and I'm a custom language not F#. My mention of F# was only because it looks like someone noticed this problem for F# and put in an explicit workaround in the targets file when the language name equals 'F#'. |
@anurse apparently you are indirectly, as @hippiehunter points out, this build task you are calling uses CodeDOM unfortunately. (oddly enough I believe I implemented it in a previous life...) |
I think someone on @mkArtakMSFT 's team is going to have to look deeper here. I don't really have any context on the Razor SDK. |
@hippiehunter - can you be specific about what we can do to help? This code generates attributes that are used by the MVC part of the runtime. |
@rynowak One option would be to make |
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process. This process is part of our issue cleanup automation. |
Under .Net Framework I used to register my CodeDomProvider in machine.config. It looks like the build targets for aspnet core have a hard requirement that languages have a CodeDomProvider, but I don't see a way to register it in netcore. Poking around in https://github.com/dotnet/runtime/blob/master/src/libraries/System.CodeDom/src/System/CodeDom/Compiler/CodeDomProvider.cs makes it look like everything is hardcoded to only support C# and VB.
The text was updated successfully, but these errors were encountered: