VB -> C#: ASP.NET Inherits-attribute in aspx file does not get renamed properly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia dalla pagina .aspx e dal relativo code-behind SomeClass.aspx.vb, quindi segui il modo in cui la conversione rinomina la classe. Assicurati che l’attributo Inherits della pagina faccia riferimento alla classe rinominata e valuta l’aggiornamento di CodeBehind da .vb a .cs come suggerito dall’issue. Il lavoro è completato quando la pagina generata risolve la classe convertita a runtime.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
VB.Net input code
In VB.net, a class can contain a method with the same name as the class. Lets call this class 'someclass'. In the aspx file, a reference is made to this file using
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="SomeClass.aspx.vb" Inherits="SomeClass" ViewStateMode="Disabled" %>
with someclass.aspx.vb looking like this:
Public Class SomeClass
Inherits BaseWebPage
Private Sub SomeClass()
'do nothing
End Sub
End Class
Erroneous output
When converted to c#, the method name can't be the same as the classname, so the converter changes the classname, and appends 'Type', resulting in:
public class SomeClassType : BaseWebPage
{
private void SomeClass()
{
//do nothing
}
}
However, the attribute Inherits="SomeClass" in the aspx file should also be changed into Inherits="SomeClassType", which does not happen currently. This won't be picked up during compilation, only at runtime, where the page will throw a 500 error, because the class-behind can't be found.
Currently, the aspx-file is not touched at all: the reference to the vb-codehind stays unchanged (instead it should be changed to .cs, but this doesn't actually impact the application so just mentioning this as a side-note).
Expected output
Must have: In the aspx-files, it should have it's Inherits-attribute changed if the classname changes.
Should have: In the aspx-files, change the CodeBehind value from .vb to .cs :)
Details
- Product in use: e.g. both
- Version in use: e.g. 9.2.5.0
- Did you see it working in a previous version: no
- Lingua principale
- C#
- Stelle
- 913
- Fork
- 244
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di icsharpcode/CodeConverter
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
icsharpcode/CodeConverter#1271 · 1 commento ·
-
C# -> VB
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
icsharpcode/CodeConverter#1281 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
icsharpcode/CodeConverter#1275 ·
-
VB -> C#
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
icsharpcode/CodeConverter#1273 ·
-
VB -> C#: "Group By Into" Linq queries supressing aggregations ("Into" part) in the converted code ApertaDifficult area VB -> C#
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
icsharpcode/CodeConverter#1272 ·
Tutte le issue di icsharpcode/CodeConverter
Issue simili
-
[Feat] 조합 영역 구분선 개선 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
type/automation type/tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
t/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
ci-failure-cause test-failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100