RazorGenerator icon indicating copy to clipboard operation
RazorGenerator copied to clipboard

global:: syntax in using declarations causes code generation error

Open kekefigure opened this issue 6 years ago • 2 comments

Example.cshtml:

@* Generator: Template TypeVisibility: Internal GeneratePrettyNames: True DisableLinePragmas: true *@
@using System
@using global::Hangfire
@using global::Hangfire.Dashboard
@using global::Hangfire.Dashboard.Pages
@using global::Hangfire.Dashboard.Resources
@inherits RazorPage
@{

}
<div class="row">
    <div class="col-md-3">
    </div>
</div>

Example.generated.cs:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using global;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    internal partial class Example: RazorPage
    {
        ...
    }

Expected result would be:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using global::Hangfire;
    using global::Hangfire.Dashboard;
    using global::Hangfire.Dashboard.Pages;
    using global::Hangfire.Dashboard.Resources;

    [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
    internal partial class Example: RazorPage
    {
        ...
    }

kekefigure avatar Sep 11 '19 07:09 kekefigure

Thanks for the report.

What version of the RazorGenerator extension and library/NuGet-package are you using?

daiplusplus avatar Sep 12 '19 05:09 daiplusplus

I'm using just the vsix extension, with version 1.12.0

kekefigure avatar Sep 12 '19 08:09 kekefigure