Skip to content

Commit 34a2c9e

Browse files
#3457: Fix incorrect handling of assemblyPath in MermaidDiagrammer/Generator.Run.cs
1 parent 3ed6da3 commit 34a2c9e

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

ICSharpCode.ILSpyX/MermaidDiagrammer/Generator.Run.cs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ partial class GenerateHtmlDiagrammer
3131
{
3232
public void Run()
3333
{
34-
var assemblyPath = GetPath(Assembly);
34+
var assemblyPath = Assembly;
3535
XmlDocumentationFormatter? xmlDocs = CreateXmlDocsFormatter(assemblyPath);
3636
ClassDiagrammer model = BuildModel(assemblyPath, xmlDocs);
3737
GenerateOutput(assemblyPath, model);
3838
}
3939

4040
protected virtual XmlDocumentationFormatter? CreateXmlDocsFormatter(string assemblyPath)
4141
{
42-
var xmlDocsPath = XmlDocs == null ? Path.ChangeExtension(assemblyPath, ".xml") : GetPath(XmlDocs);
42+
var xmlDocsPath = XmlDocs == null ? Path.ChangeExtension(assemblyPath, ".xml") : XmlDocs;
4343
XmlDocumentationFormatter? xmlDocs = null;
4444

4545
if (File.Exists(xmlDocsPath))
@@ -132,15 +132,5 @@ private void GenerateOutput(string assemblyPath, ClassDiagrammer model)
132132
File.WriteAllText(Path.Combine(outputFolder, "excluded types.txt"), excludedTypes);
133133
}
134134
}
135-
136-
private protected virtual string GetPath(string pathOrUri)
137-
{
138-
// convert file:// style argument, see https://stackoverflow.com/a/38245329
139-
if (!Uri.TryCreate(pathOrUri, UriKind.RelativeOrAbsolute, out Uri? uri))
140-
throw new ArgumentException("'{0}' is not a valid URI", pathOrUri);
141-
142-
// support absolute paths as well as file:// URIs and interpret relative path as relative to the current directory
143-
return uri.IsAbsoluteUri ? uri.AbsolutePath : pathOrUri;
144-
}
145135
}
146136
}

0 commit comments

Comments
 (0)