Skip to content

Commit 5e7b693

Browse files
fix: support - symbols in csproj names (#1921)
* fix: support - symbols in csproj names * fix: revert * fix: remove -,@ symbols in namespaces --------- Co-authored-by: Chris Pulman <chris.pulman@yahoo.com>
1 parent 8cb6f75 commit 5e7b693

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

InterfaceStubGenerator.Shared/Parser.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ CancellationToken cancellationToken
3434

3535
refitInternalNamespace = $"{refitInternalNamespace ?? string.Empty}RefitInternalGenerated";
3636

37+
// Remove - as they are valid in csproj, but invalid in a namespace
38+
refitInternalNamespace = refitInternalNamespace.Replace('-', '_').Replace('@', '_');
39+
3740
// we're going to create a new compilation that contains the attribute.
3841
// TODO: we should allow source generators to provide source during initialize, so that this step isn't required.
3942
var options = (CSharpParseOptions)compilation.SyntaxTrees[0].Options;

0 commit comments

Comments
 (0)