Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Port to 2.0.1: TagHelper error: A local or parameter named '__model' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter #1618

Closed
Eilon opened this issue Aug 15, 2017 · 22 comments

Comments

@Eilon
Copy link
Member

Eilon commented Aug 15, 2017

Port this fix to 2.0.1: #1614

@Eilon Eilon added this to the 2.0.1 milestone Aug 15, 2017
@Eilon Eilon changed the title Port to 2.0.1: 2.0 TagHelper error: A local or parameter named '__model' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter Port to 2.0.1: TagHelper error: A local or parameter named '__model' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter Aug 15, 2017
@NTaylorMullen
Copy link
Member

Will complete this work when we have 2.0.1 infrastructure in place.

@bdominguez
Copy link

Estimated date for release? This is a show stopper for me on upgrading to 2.0.

@Eilon
Copy link
Member Author

Eilon commented Aug 21, 2017

@bdominguez we plan to release this in mid-September. Hard to pin down an exact date. However, we'll have pre-release builds of the patch before then, and we'll share details about that once the builds are ready.

@bdominguez
Copy link

@Eilon thanks.

@Gaelmart
Copy link

This has stopped 6 months of work dead at the last step.
Is there a hack or ANYTHING that can get me past it.?

@Eilon
Copy link
Member Author

Eilon commented Aug 23, 2017

For folks running into this, can you show what code you have in your @section so that we can try to offer workarounds? The exact workaround (if one is available) would depend on what code is in the section.

@Gaelmart
Copy link

Gaelmart commented Aug 23, 2017

The __model errors happen on the lines and only errors on publish to Azure (it builds fine)

<label asp-for="Password" class="col-md-2 control-label"></label>
<span asp-validation-for="Password" class="text-danger"></span>
<label asp-for="ConfirmPassword" class="col-md-3 control-label"></label>
<span asp-validation-for="ConfirmPassword" class="text-danger"></span>
<span asp-validation-for="Terms" class="text-danger"></span>
@model iBasisMobileV14.Models.AccountViewModels.SignupViewModel
@{
    ViewData["Title"] = "iBASIS Spares Search";
}

@{
    Layout = "~/Views/Shared/_SignupLayout.cshtml";
}
@*This is due to Angular Universals prerendering,
    and things such as window and jQuery not being
    available on the server side.
    You can follow angular/universal#534 as we try to make these things
    available or at the very least ignored on
    the server side to prevent errors.For now you can remove the asp-prerender attribute on the Index View to
    disable server side rendering if you need these libraries to work for now.
*@


@*<app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>*@
@*<app>Loading...</app>*@

@*<script src="~/dist/vendor.js" asp-append-version="true">
    </script>*@

@section content{

    @*<router-outlet></router-outlet>*@
  @*@Html.RenderPartial("_partialSignup");*@

<div class="Header-staticArea">
    <span class="icon-globe" style="font-size: .9rem;"> </span> Boiler and Spares Information Services
</div>

<div class="Landing">

    <section class="normal-content ms-Grid">
        <div class="row">
            <div class="col-lg-12 ">
                <div class="stackable">
                    <div class="page-block">
                        <div class="page-inner">
                            @*<div class="p-sm">
                                    <h2 class="pheader" color="gray1">
                                        <span>
                                            Thank you for becoming an iBasis Member
                                        </span>
                                    </h2>
                                </div>*@
                            <div class="container-fluid">


                                <div class="page-center enter-details col-12 col-sm-8">
                                    <div class="" wrap="nowrap">
                                        <div class="text-content">
                                            <h3>
                                                Enter your details
                                            </h3>
                                            <div class="row">
                                                <div class="col-12">
                                                    
                                                    <form asp-controller="Signup" asp-action="Index" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal">
                                                        <div class="form-group">
                                                            <label for="Fullname" class="col-md-2 control-label">Full name:</label>
                                                            <div class="col-md-10">
                                                                @Html.TextBoxFor(m => m.Fullname, new { @class = "form-control", @placeholder = "Enter Full Name" })
                                                                @*<input type="text" asp-for="PublicViewModel.SignupViewModel.Fullname" class="form-control" id="Fullname" placeholder="Enter Full Name">*@
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label for="SignupUsername" class="col-md-2 control-label">User name:</label>
                                                            <div class="col-md-10">
                                                                @Html.TextBoxFor(m => m.Username, new { @class = "form-control", @placeholder = "Choose a User Name" })
                                                                @*<input type="text" class="form-control" id="SignupUsername" placeholder="Choose a User Username">*@
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label for="Email" class="col-md-2 control-label">Email address:</label>
                                                            <div class="col-md-10">
                                                                @Html.TextBoxFor(m => m.Email, new { @class = "form-control", @placeholder = "Enter email", @id = "Email" })
                                                                @*< input type="email" asp-for="SignupEmail" class="form-control" id="SignupEmail" aria-describedby="emailHelp" placeholder="Enter email">*@
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label asp-for="Password" class="col-md-2 control-label"></label>
                                                            <div class="col-md-10">
                                                                @Html.TextBoxFor(m => m.Password, new { @class = "form-control", @placeholder = "Choose Password", @id = "Password" })
                                                                @*<input asp-for="SignupPassword" class="form-control" />*@
                                                                <span asp-validation-for="Password" class="text-danger"></span>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <label asp-for="ConfirmPassword" class="col-md-3 control-label"></label>
                                                            <div class="col-md-10">
                                                                @Html.TextBoxFor(m => m.ConfirmPassword, new { @class = "form-control", @placeholder = "Retype Password" })
                                                                @*<input asp-for="SignupConfirmPassword" class="form-control" />*@
                                                                <span asp-validation-for="ConfirmPassword" class="text-danger"></span>
                                                            </div>
                                                        </div>
                                                        <div class="form-check">
                                                            <label class="form-check-label">
                                                                @Html.CheckBoxFor(m => m.Terms, new { @class = "form-check-input", })
                                                                @*<input asp-for="Terms"   type="checkbox" class="form-check-input">*@
                                                                I aggree to iBasis Terms & conditions
                                                            </label>
                                                            <span asp-validation-for="Terms" class="text-danger"></span>
                                                        </div>
                                                        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                                                        <button type="submit" class="btn btn-primary">Submit</button>
                                                    </form>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>
    </section>
</div>


}
   


@section scripts {
    @*<script src="~/dist/main-client.js" asp-append-version="true">
        </script>*@

    @*<script src="~/lib/jasny-bootstrap/js/jasny-bootstrap.js" asp-append-version="true">
        </script>*@
    <script src="~/dist/static/js/libs/jquery.min.js">
    </script>
    <script src="~/dist/static/js/libs/tether.min.js">
    </script>
    <script src="~/dist/static/js/libs/bootstrap.min.js">
    </script>
    <script src="~/dist/static/js/app.js">
    </script>

    <script src="~/js/site.js" asp-append-version="true">
    </script>
}

@Eilon
Copy link
Member Author

Eilon commented Aug 25, 2017

@Gaelmart thanks. @NTaylorMullen - any idea if there's a workaround that could be used for this?

@NTaylorMullen
Copy link
Member

@Gaelmart one workaround you could do would be to throw all that TagHelper code that utilizes asp-for into a partial. I know it isn't ideal but it will work! 😄

@Eilon
Copy link
Member Author

Eilon commented Aug 28, 2017

@NTaylorMullen ah that's probably a pretty good workaround that should work in most cases, though it's of course a bit messy.

@Eilon
Copy link
Member Author

Eilon commented Sep 15, 2017

This patch bug is approved for the 2.0.x patch. Please send a PR to the feature/2.0.1 branch and get it reviewed and merged. When we have the rel/2.0.1 branches ready please port the commit to that branch.

@Eilon
Copy link
Member Author

Eilon commented Sep 15, 2017

@ajaybhargavb - I reassigned this to you because @NTaylorMullen is still out.

@ajaybhargavb
Copy link
Contributor

ajaybhargavb commented Sep 15, 2017

888e6bf on branch feature/2.0.1.

@rajsingh216
Copy link

rajsingh216 commented Sep 18, 2017

Please may I ask how can we get the fix?

@poke
Copy link

poke commented Sep 18, 2017

@rajsingh216 Update to version 2.0.1 once it’s released…

@poke
Copy link

poke commented Oct 11, 2017

@Eilon In response to this comment, is there any update on when 2.0.3 is going to be released? I heard you had some release infrastructure problems which are resolved now, so do you have any date you can share? My team is getting a bit anxious since we are still holding off the upgrade because of this.

@Eilon
Copy link
Member Author

Eilon commented Oct 11, 2017

@poke we unfortunately still have some infrastructure issues, but we are working right now on getting a preview build of 2.0.3 that people can try out. We don't have an exact date to share on the final release of 2.0.3 just yet.

@poke
Copy link

poke commented Oct 11, 2017

@Eilon A preview release would work just fine for me! Anything to allow me to move to 2.0 is great! Thanks for the update and good luck with your infrastructure :)

@Eilon
Copy link
Member Author

Eilon commented Oct 11, 2017

@poke thanks, we're working through it! I will update all patch issues with download details when we have a build available to test.

@stefan505
Copy link

stefan505 commented Oct 18, 2017

@Eilon any news on this? I had to jump through some hoops to successfully upgrade to 2.0 as a result of this, but its not sustainable.

@Eilon
Copy link
Member Author

Eilon commented Oct 18, 2017

@stefan505 we're working on this right now. It's a bit complicated due to some infrastructure issues but it's a high priority for us.

@Eilon
Copy link
Member Author

Eilon commented Oct 23, 2017

Hi, we have a public test feed that you can use to try out the ASP.NET/EF Core 2.0.3 patch!

To try out the pre-release patch, please refer to the following guide:

We are looking for feedback on this patch. We'd like to know if you have any issues with this patch by updating your apps and libraries to the latest packages and seeing if it fixes the issues you've had, or if it introduces any new issues. If you have any issues or questions, please reply on this issue to let us know as soon as possible.

Thanks,
Eilon

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants