-
Notifications
You must be signed in to change notification settings - Fork 221
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
Convert ASP.NET (+core) cshtml/vbhtml files #172
Comments
A similar solution could probably also cover #219 |
Has there been movement on this? We have a huge web application with hundreds of vbhtml files and could use a helping hand. |
Just to check I'm looking at the right thing, am I right in thinking it's .net framework 4.8 that's the latest version that supports vbhtml? Is that what you're using? I've started adding some background information to the issue description. The good news is that it's possible to get at and convert the code itself, the less good news is that it needs a fair amount of surrounding code to be useful on the scale. If you, or anyone else is interested in doing some digging in the roslyn repo for the relevant parts I've mentioned that would be a huge help. |
I've got a spike that gets me access to what's needed I think, but it's reflection heavy: #1110 |
Related info for aspx is probably relevant here: #175
May be necessary to use things like
to get the syntax tree, or may already be in the syntax trees and just need special treatment.
Out of scope: ASP Net Classic will not be supported
Background
For each file that currently has an open editor, we receive a whole project object (same file path as the one containing the vbhtml) with a bit of boilerplate and then a projection of each code block in the vbhtml
e.g. About.vbhtml
About.vbhtml.__projection.g.vb:
So we need:
Layout = "~/Views/Shared/_Layout.vbhtml"
Using internals
Given a bunch of internal interfaces, this may be a good time to try out the new way of accessing such things (with appropriate guards of course): https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.unsafeaccessorattribute?view=net-8.0#examples
Side note
There's a snippet here which tells us how we should be getting the right one of these projects normally (currently it just grabs the first!)
https://github.com/dotnet/roslyn/blob/e102ec27b9a89b4ee462f93bcd3295a66c439329/src/VisualStudio/Core/Def/Implementation/HierarchyItemToProjectIdMap.cs#L76-L87
The text was updated successfully, but these errors were encountered: