Quantcast
Channel: ASP.NET Core
Viewing all 9386 articles
Browse latest View live

Why MapFallbackToController is not working? asp.net core 3.1.1 + angular

$
0
0

I finished my app and i want to publish it into web. Working on core 3.1.1 + angular2.

I created Fallback controller for routes.

After i'm refeshing page i got HTTP 401 Unauthorized.

I chcecked into my local storage and it's clear when it shouldn't be..

I have problem when i refresh page in response i got HTTP 401 unauthorized.. (and my local storage is clear, when it shouldn't) It's very strange.. Everything worked perfect until moved angular files(wwwroot) into API proj.

I have no ideas.

My code of fallback:

   public class Fallback : Controller
    {
        public IActionResult Index()
        {
            return PhysicalFile(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "index.html"), "text/HTML");
        }
    }

Startup.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.IdentityModel.Tokens;
using RecipesApp.API.Controllers.Models.Data;
using RecipesApp.API.Data;
using RecipesApp.API.Helpers;

namespace RecipesApp.API
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext<DataContext>( x=> x.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
            services.AddControllers().AddNewtonsoftJson(opt => {
                opt.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
            });

            services.AddCors();
            services.Configure<CloudinarySettings>(Configuration.GetSection("CloudinarySettings"));
            services.AddAutoMapper(typeof(RecipesRepository).Assembly);
            services.AddScoped<IAuthRepository, AuthRepository>();
            services.AddScoped<IUserRepository, UserRepository>();
            services.AddScoped<IRecipesRepository, RecipesRepository>();
            services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
            .AddJwtBearer(options => {
                options.TokenValidationParameters = new TokenValidationParameters
                {
                    ValidateIssuerSigningKey = true,
                    IssuerSigningKey = new SymmetricSecurityKey(Encoding.ASCII
                    .GetBytes(Configuration
                    .GetSection("AppSettings:Token").Value)),
                    ValidateIssuer = false,
                    ValidateAudience = false
                };
            });
            services.AddScoped<LogUserActivity>();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else 
            {
                app.UseExceptionHandler(builder => 
                {
                    builder.Run(async context => 
                    {
                        context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;

                        var error = context.Features.Get<IExceptionHandlerFeature>();
                        if (error != null)
                        {
                            context.Response.AddApplicationError(error.Error.Message);
                            await context.Response.WriteAsync(error.Error.Message);
                        }
                    });
                });
            }

            // app.UseHttpsRedirection();

            
           
            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseCors(x => x.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());

            app.UseDefaultFiles();
            app.UseStaticFiles();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapFallbackToController("Index", "Fallback");
            });
        }
    }
}




Javascript and Asp.Net Core 3.1 input check boxes broken

$
0
0

Hello,

     So I had this working in Asp.net Core 2.2 with Twitter-Bootstrap 3.3.7.  I then upgraded to Asp.net Core 3.1 and Twitter-Bootstrap 4.4.  Now I am unable to get some of my javascript functions to work.  Setting breakpoints in the javascript in Chrome and Edge, they do not get hit at all.  Though I ran the output from the web through JS Fiddle and it works perfectly fine there.  So I am at a loss for what I did to break this.

What I have is a gating function within javascript that will uncheck any check boxes that are in sequence after a check box if it is unchecked, if it is checked it will enable the next available check box, leaving the others disabled.  When I run it in IIS Express this no longer happens.

Here is the Javascript I have for one page:

//Loops through the checkboxes and disables the next ones if the previous is not checked
function changeFields(fields) {
    fields.change(function () {
        Array.prototype.reduce.call(fields, function (prev, curr) {
            curr.disabled = !prev.checked || prev.disabled;


            //If you want to uncheck remaining use this instead of above line:
            curr.checked = prev.checked ? curr.checked : false;
            curr.disabled = !prev.checked;

            return curr;
        });
    });
}

//Call the for the CharacterCraft
changeFields($(".cALScb"));
changeFields($(".cALMcb"));
changeFields($(".cBLScb"));
changeFields($(".cBLMcb"));
changeFields($(".cCLScb"));
changeFields($(".cCLMcb"));



Here is the what I have in view calling this:

<form asp-controller="CharacterCrafts" asp-action="Edit" method="post"><div class="form-horizontal"><hr />
        @Html.ValidationSummary( true, "", new { @class = "text-danger" } )<div class="col-lg-12 text-center"><b style="text-align: center; font-family: 'Times New Roman', Times, serif; font-size: x-large">@Html.DisplayFor( a => a.CharNames.CharFullName )</b><br /><b style="text-align: center; font-family: 'Times New Roman', Times, serif; font-size: large">@Html.DisplayFor( a => a.CharNames.ProfName )</b></div><br /><br /><div class="form-group"><div class="form-group row"><div class="col-lg-2">
                    @Html.Label( "Crafting Class" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Achieved" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Name" )</div><div class="col-lg-1">
                    @Html.Label( "Mastery" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Achieved" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Name" )</div><div class="col-lg-1">
                    @Html.Label( "Mastery" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Achieved" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Name" )</div><div class="col-lg-1">
                    @Html.Label( "Mastery" )</div></div><div class="form-group row">
                @for ( var h = 0; h<1; h++ )
                {<div class="col-lg-2"><br /><br /><br /><b>@Html.DisplayFor( a => a.CraftListA[ h ].CraftClassName )</b><br /><br /></div><div class="form-group row col-lg-10">
                        @{ int j = 0;}
                        @for ( var i = 0; i<Model.CraftListA.Count; i++ )
                        {<input type="hidden" asp-for="@Model.CraftListA[i].CharCraftCharID" /><input type="hidden" asp-for="@Model.CraftListA[i].CharCraftClassID" /><input type="hidden" asp-for="@Model.CraftListA[i].CharCraftLevelID" /><input type="hidden" asp-for="@Model.CraftListA[i].CraftLevelTier" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListA[i].CraftLevelSet" class="cALScb" /></div><div class="col-lg-2"><b>@Html.DisplayFor( a => a.CraftListA[ i ].CraftLevelName )</b></div><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListA[i].CraftLevelMastery" class="cALMcb" /></div>
                            j++;
                            if ( j==3 )
                            {<br />
                                j=0;
                            }
                            else
                            {
                                continue;
                            }
                        }</div>
                }</div><div class="form-group row">
                @for ( var h = 0; h<1; h++ )
                {<div class="col-lg-2"><br /><br /><br /><b>@Html.DisplayFor( a => a.CraftListB[ h ].CraftClassName )</b><br /><br /></div><div class="form-group row col-lg-10">
                        @{ int j = 0;}
                        @for ( var i = 0; i<Model.CraftListB.Count; i++ )
                        {<input type="hidden" asp-for="@Model.CraftListB[i].CharCraftCharID" /><input type="hidden" asp-for="@Model.CraftListB[i].CharCraftClassID" /><input type="hidden" asp-for="@Model.CraftListB[i].CharCraftLevelID" /><input type="hidden" asp-for="@Model.CraftListB[i].CraftLevelTier" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListB[i].CraftLevelSet" class="cBLScb" /></div><div class="col-lg-2"><b>@Html.DisplayFor( a => a.CraftListB[ i ].CraftLevelName )</b></div><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListB[i].CraftLevelMastery" class="cBLMcb" /></div>
                            j++;
                            if ( j==3 )
                            {<br />
                                j=0;
                            }
                            else
                            {
                                continue;
                            }
                        }</div>
                }</div><div class="form-group row">
                @for ( var h = 0; h<1; h++ )
                {<div class="col-lg-2"><br /><br /><br /><b>@Html.DisplayFor( a => a.CraftListC[ h ].CraftClassName )</b><br /><br /></div><div class="form-group row col-lg-10">
                        @{ int j = 0;}
                        @for ( var i = 0; i<Model.CraftListC.Count; i++ )
                        {<input type="hidden" asp-for="@Model.CraftListC[i].CharCraftCharID" /><input type="hidden" asp-for="@Model.CraftListC[i].CharCraftClassID" /><input type="hidden" asp-for="@Model.CraftListC[i].CharCraftLevelID" /><input type="hidden" asp-for="@Model.CraftListC[i].CraftLevelTier" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListC[i].CraftLevelSet" class="cCLScb" /></div><div class="col-lg-2"><b>@Html.DisplayFor( a => a.CraftListC[ i ].CraftLevelName )</b></div><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListC[i].CraftLevelMastery" class="cCLMcb" /></div>
                            j++;
                            if ( j==3 )
                            {<br />
                                j=0;
                            }
                            else
                            {
                                continue;
                            }
                        }</div>
                }</div></div><div class="form-group row"><div class="col-lg-12 row"><div class="col-lg-3"><b>Select a Guild:</b></div>
                @for ( var i = 0; i<Model.Guild.Count; i++ )
                {<input type="hidden" asp-for="@Model.Guild[i].FactionID" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.Guild[i].isChecked" /></div><div class="col-lg-3"><b>@Html.DisplayFor( a => a.Guild[ i ].FactionName )</b></div>
                }</div></div><div class="form-group row"><div class="col-lg-12 row"><div class="col-lg-offset-2 col-lg-2"><input type="submit" value="Save" class="btn btn-secondary" /></div><div class="col-lg-5"></div><div class="col-lg-2"><a asp-controller="Menu" , asp-action="EdChar" , null, class="btn btn-danger">Cancel</a></div></div></div></div></form>

Everything displays correctly on the page, but after an unchecked check box everything is still enabled.  This can been seen in the output from Edge:

<div class="form-group"><div class="form-group row"><div class="col-lg-2"><label for="Crafting_Class">Crafting Class</label></div><div class="col-lg-1"><label for="Tier_Achieved">Tier Achieved</label></div><div class="col-lg-1"><label for="Tier_Name">Tier Name</label></div><div class="col-lg-1"><label for="Mastery">Mastery</label></div><div class="col-lg-1"><label for="Tier_Achieved">Tier Achieved</label></div><div class="col-lg-1"><label for="Tier_Name">Tier Name</label></div><div class="col-lg-1"><label for="Mastery">Mastery</label></div><div class="col-lg-1"><label for="Tier_Achieved">Tier Achieved</label></div><div class="col-lg-1"><label for="Tier_Name">Tier Name</label></div><div class="col-lg-1"><label for="Mastery">Mastery</label></div></div><div class="form-group row"><div class="col-lg-2"><br><br><br><b>Farmer</b><br><br></div><div class="form-group row col-lg-10"><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_0__CharCraftCharID" name="CraftListA[0].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_0__CharCraftClassID" name="CraftListA[0].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_0__CharCraftLevelID" name="CraftListA[0].CharCraftLevelID" value="1"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_0__CraftLevelTier" name="CraftListA[0].CraftLevelTier" value="1"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_0__CraftLevelSet" name="CraftListA[0].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Apprentice</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_0__CraftLevelMastery" name="CraftListA[0].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_1__CharCraftCharID" name="CraftListA[1].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_1__CharCraftClassID" name="CraftListA[1].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_1__CharCraftLevelID" name="CraftListA[1].CharCraftLevelID" value="5"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_1__CraftLevelTier" name="CraftListA[1].CraftLevelTier" value="2"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_1__CraftLevelSet" name="CraftListA[1].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Journeyman</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_1__CraftLevelMastery" name="CraftListA[1].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_2__CharCraftCharID" name="CraftListA[2].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_2__CharCraftClassID" name="CraftListA[2].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_2__CharCraftLevelID" name="CraftListA[2].CharCraftLevelID" value="4"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_2__CraftLevelTier" name="CraftListA[2].CraftLevelTier" value="3"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_2__CraftLevelSet" name="CraftListA[2].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Expert</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_2__CraftLevelMastery" name="CraftListA[2].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_3__CharCraftCharID" name="CraftListA[3].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_3__CharCraftClassID" name="CraftListA[3].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_3__CharCraftLevelID" name="CraftListA[3].CharCraftLevelID" value="2"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_3__CraftLevelTier" name="CraftListA[3].CraftLevelTier" value="4"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_3__CraftLevelSet" name="CraftListA[3].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Artisan</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_3__CraftLevelMastery" name="CraftListA[3].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_4__CharCraftCharID" name="CraftListA[4].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_4__CharCraftClassID" name="CraftListA[4].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_4__CharCraftLevelID" name="CraftListA[4].CharCraftLevelID" value="6"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_4__CraftLevelTier" name="CraftListA[4].CraftLevelTier" value="5"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_4__CraftLevelSet" name="CraftListA[4].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Master</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_4__CraftLevelMastery" name="CraftListA[4].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_5__CharCraftCharID" name="CraftListA[5].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_5__CharCraftClassID" name="CraftListA[5].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_5__CharCraftLevelID" name="CraftListA[5].CharCraftLevelID" value="7"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_5__CraftLevelTier" name="CraftListA[5].CraftLevelTier" value="6"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_5__CraftLevelSet" name="CraftListA[5].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Supreme</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_5__CraftLevelMastery" name="CraftListA[5].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_6__CharCraftCharID" name="CraftListA[6].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_6__CharCraftClassID" name="CraftListA[6].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_6__CharCraftLevelID" name="CraftListA[6].CharCraftLevelID" value="9"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_6__CraftLevelTier" name="CraftListA[6].CraftLevelTier" value="7"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_6__CraftLevelSet" name="CraftListA[6].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westfold</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_6__CraftLevelMastery" name="CraftListA[6].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_7__CharCraftCharID" name="CraftListA[7].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_7__CharCraftClassID" name="CraftListA[7].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_7__CharCraftLevelID" name="CraftListA[7].CharCraftLevelID" value="3"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_7__CraftLevelTier" name="CraftListA[7].CraftLevelTier" value="8"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_7__CraftLevelSet" name="CraftListA[7].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Eastenmnet</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_7__CraftLevelMastery" name="CraftListA[7].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_8__CharCraftCharID" name="CraftListA[8].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_8__CharCraftClassID" name="CraftListA[8].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_8__CharCraftLevelID" name="CraftListA[8].CharCraftLevelID" value="8"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_8__CraftLevelTier" name="CraftListA[8].CraftLevelTier" value="9"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_8__CraftLevelSet" name="CraftListA[8].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westemnet</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_8__CraftLevelMastery" name="CraftListA[8].CraftLevelMastery" value="true"></div><br></div></div><div class="form-group row"><div class="col-lg-2"><br><br><br><b>Scholar</b><br><br></div><div class="form-group row col-lg-10"><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_0__CharCraftCharID" name="CraftListB[0].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_0__CharCraftClassID" name="CraftListB[0].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_0__CharCraftLevelID" name="CraftListB[0].CharCraftLevelID" value="1"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_0__CraftLevelTier" name="CraftListB[0].CraftLevelTier" value="1"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_0__CraftLevelSet" name="CraftListB[0].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Apprentice</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_0__CraftLevelMastery" name="CraftListB[0].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_1__CharCraftCharID" name="CraftListB[1].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_1__CharCraftClassID" name="CraftListB[1].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_1__CharCraftLevelID" name="CraftListB[1].CharCraftLevelID" value="5"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_1__CraftLevelTier" name="CraftListB[1].CraftLevelTier" value="2"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_1__CraftLevelSet" name="CraftListB[1].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Journeyman</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_1__CraftLevelMastery" name="CraftListB[1].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_2__CharCraftCharID" name="CraftListB[2].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_2__CharCraftClassID" name="CraftListB[2].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_2__CharCraftLevelID" name="CraftListB[2].CharCraftLevelID" value="4"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_2__CraftLevelTier" name="CraftListB[2].CraftLevelTier" value="3"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_2__CraftLevelSet" name="CraftListB[2].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Expert</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_2__CraftLevelMastery" name="CraftListB[2].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_3__CharCraftCharID" name="CraftListB[3].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_3__CharCraftClassID" name="CraftListB[3].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_3__CharCraftLevelID" name="CraftListB[3].CharCraftLevelID" value="2"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_3__CraftLevelTier" name="CraftListB[3].CraftLevelTier" value="4"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_3__CraftLevelSet" name="CraftListB[3].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Artisan</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_3__CraftLevelMastery" name="CraftListB[3].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_4__CharCraftCharID" name="CraftListB[4].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_4__CharCraftClassID" name="CraftListB[4].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_4__CharCraftLevelID" name="CraftListB[4].CharCraftLevelID" value="6"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_4__CraftLevelTier" name="CraftListB[4].CraftLevelTier" value="5"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_4__CraftLevelSet" name="CraftListB[4].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Master</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_4__CraftLevelMastery" name="CraftListB[4].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_5__CharCraftCharID" name="CraftListB[5].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_5__CharCraftClassID" name="CraftListB[5].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_5__CharCraftLevelID" name="CraftListB[5].CharCraftLevelID" value="7"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_5__CraftLevelTier" name="CraftListB[5].CraftLevelTier" value="6"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_5__CraftLevelSet" name="CraftListB[5].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Supreme</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_5__CraftLevelMastery" name="CraftListB[5].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_6__CharCraftCharID" name="CraftListB[6].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_6__CharCraftClassID" name="CraftListB[6].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_6__CharCraftLevelID" name="CraftListB[6].CharCraftLevelID" value="9"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_6__CraftLevelTier" name="CraftListB[6].CraftLevelTier" value="7"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_6__CraftLevelSet" name="CraftListB[6].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westfold</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_6__CraftLevelMastery" name="CraftListB[6].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_7__CharCraftCharID" name="CraftListB[7].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_7__CharCraftClassID" name="CraftListB[7].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_7__CharCraftLevelID" name="CraftListB[7].CharCraftLevelID" value="3"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_7__CraftLevelTier" name="CraftListB[7].CraftLevelTier" value="8"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_7__CraftLevelSet" name="CraftListB[7].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Eastenmnet</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_7__CraftLevelMastery" name="CraftListB[7].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_8__CharCraftCharID" name="CraftListB[8].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_8__CharCraftClassID" name="CraftListB[8].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_8__CharCraftLevelID" name="CraftListB[8].CharCraftLevelID" value="8"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_8__CraftLevelTier" name="CraftListB[8].CraftLevelTier" value="9"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_8__CraftLevelSet" name="CraftListB[8].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westemnet</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_8__CraftLevelMastery" name="CraftListB[8].CraftLevelMastery" value="true"></div><br></div></div><div class="form-group row"><div class="col-lg-2"><br><br><br><b>Weaponsmith</b><br><br></div><div class="form-group row col-lg-10"><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_0__CharCraftCharID" name="CraftListC[0].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_0__CharCraftClassID" name="CraftListC[0].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_0__CharCraftLevelID" name="CraftListC[0].CharCraftLevelID" value="1"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_0__CraftLevelTier" name="CraftListC[0].CraftLevelTier" value="1"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_0__CraftLevelSet" name="CraftListC[0].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Apprentice</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_0__CraftLevelMastery" name="CraftListC[0].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_1__CharCraftCharID" name="CraftListC[1].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_1__CharCraftClassID" name="CraftListC[1].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_1__CharCraftLevelID" name="CraftListC[1].CharCraftLevelID" value="5"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_1__CraftLevelTier" name="CraftListC[1].CraftLevelTier" value="2"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_1__CraftLevelSet" name="CraftListC[1].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Journeyman</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_1__CraftLevelMastery" name="CraftListC[1].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_2__CharCraftCharID" name="CraftListC[2].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_2__CharCraftClassID" name="CraftListC[2].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_2__CharCraftLevelID" name="CraftListC[2].CharCraftLevelID" value="4"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_2__CraftLevelTier" name="CraftListC[2].CraftLevelTier" value="3"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_2__CraftLevelSet" name="CraftListC[2].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Expert</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_2__CraftLevelMastery" name="CraftListC[2].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_3__CharCraftCharID" name="CraftListC[3].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_3__CharCraftClassID" name="CraftListC[3].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_3__CharCraftLevelID" name="CraftListC[3].CharCraftLevelID" value="2"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_3__CraftLevelTier" name="CraftListC[3].CraftLevelTier" value="4"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_3__CraftLevelSet" name="CraftListC[3].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Artisan</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_3__CraftLevelMastery" name="CraftListC[3].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_4__CharCraftCharID" name="CraftListC[4].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_4__CharCraftClassID" name="CraftListC[4].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_4__CharCraftLevelID" name="CraftListC[4].CharCraftLevelID" value="6"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_4__CraftLevelTier" name="CraftListC[4].CraftLevelTier" value="5"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_4__CraftLevelSet" name="CraftListC[4].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Master</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_4__CraftLevelMastery" name="CraftListC[4].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_5__CharCraftCharID" name="CraftListC[5].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_5__CharCraftClassID" name="CraftListC[5].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_5__CharCraftLevelID" name="CraftListC[5].CharCraftLevelID" value="7"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_5__CraftLevelTier" name="CraftListC[5].CraftLevelTier" value="6"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_5__CraftLevelSet" name="CraftListC[5].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Supreme</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_5__CraftLevelMastery" name="CraftListC[5].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_6__CharCraftCharID" name="CraftListC[6].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_6__CharCraftClassID" name="CraftListC[6].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_6__CharCraftLevelID" name="CraftListC[6].CharCraftLevelID" value="9"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_6__CraftLevelTier" name="CraftListC[6].CraftLevelTier" value="7"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_6__CraftLevelSet" name="CraftListC[6].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westfold</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_6__CraftLevelMastery" name="CraftListC[6].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_7__CharCraftCharID" name="CraftListC[7].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_7__CharCraftClassID" name="CraftListC[7].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_7__CharCraftLevelID" name="CraftListC[7].CharCraftLevelID" value="3"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_7__CraftLevelTier" name="CraftListC[7].CraftLevelTier" value="8"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_7__CraftLevelSet" name="CraftListC[7].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Eastenmnet</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_7__CraftLevelMastery" name="CraftListC[7].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_8__CharCraftCharID" name="CraftListC[8].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_8__CharCraftClassID" name="CraftListC[8].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_8__CharCraftLevelID" name="CraftListC[8].CharCraftLevelID" value="8"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_8__CraftLevelTier" name="CraftListC[8].CraftLevelTier" value="9"><div class="col-lg-1"><input type="checkbox" class="cCLScb" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_8__CraftLevelSet" name="CraftListC[8].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westemnet</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_8__CraftLevelMastery" name="CraftListC[8].CraftLevelMastery" value="true"></div><br></div></div></div>

Ideally from the output the very last check box should be disabled, but it is not.  Though if I go to JS Fiddle, this works as such: https://jsfiddle.net/MikeRM2/bzfcme06/

So this leads to wondering what went wrong, as it works in JS Fiddle but not on the actual site.  I am not getting any errors in the console or debug.  Any thoughts on why this is not working anymore would be appreciated.

How to uninstall .Net Core

$
0
0

I am trying to uninstall .NET core runtime version 2.1 which is part of Visual Studio 2019 Professional (16.5.4). Here's how it currently looks like:

C:\Windows\system32>dotnet --list-sdks
3.1.201 [C:\Program Files\dotnet\sdk]

C:\Windows\system32>dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

They are no where to found in Control Panel because probably they are part of Visual Studio. The reason for uninstalling is that I have received following advisory:

http://www.nessus.org/u?530ba67f

And which took me to following page where all .NET Core 2.1 versions are listed.

https://dotnet.microsoft.com/download/dotnet-core/2.1

.NET core feels like version hell like we had DLL hell at one time and it is very confusing. How do I uninstall 2.1 from my machine? I already went into VS, then I clicked on "Modify" and unchecked versions 2.1 but these are still there.

Error in Update child record EF Core 3.0 The association between entities has been severed but the relationship is either marked as 'Required'

$
0
0

I'm using EF Core version: 3.0 Database provider: Microsoft.EntityFrameworkCore.SqlServer

I have two tables: PROFILO (master) and PROFILOTITOLODISTUDIO (details) this is the model:

PROFILO MODEL

publicpartialclassProfilo{publicProfilo(){ProfiloTitoloDiStudio=newList<ProfiloTitoloDiStudio>();}[Key]publicGuidIdProfilo{get;set;}[Required][StringLength(256)]publicstringNome{get;set;}[StringLength(256)]publicstringCognome{get;set;}[InverseProperty("IdProfiloNavigation")]publicvirtualIList<ProfiloTitoloDiStudio>ProfiloTitoloDiStudio{get;set;}}

PROFILOTITOLODISTUDIO MODEL

publicpartialclassProfiloTitoloDiStudio{[Key]publicintIdProfiloTitoloDiStudio{get;set;}publicGuidIdProfilo{get;set;}[Required][StringLength(256)]publicstringDenominazioneCorsoStudio{get;set;}[ForeignKey(nameof(IdProfilo))][InverseProperty(nameof(Profilo.ProfiloTitoloDiStudio))]publicvirtualProfiloIdProfiloNavigation{get;set;}}

The IdProfilo foreign key in the PROFILOTITOLODISTUDIO tablemust be NOT NULL

In the controller's Edit action I receive the object with the fields bounded by the view as an input, even if I don't change any value, thesavechanges () always returns the error:

InvalidOperationException: The association between entities 'Profilo' and 'ProfiloTitoloDiStudio' with the key value '{IdProfilo: 45c42779-39b6-4047-91d1-12253a79b7f6}' has been severed but the relationship is either marked as 'Required' or is implicitly required because the foreign key is not nullable. If the dependent/child entity should be deleted when a required relationship is severed, then setup the relationship to use cascade deletes.

this is the save code:

publicasyncTask<IActionResult>Edit(Profilo profiloinput){var _profiloDB =await _dbcontext.Profilo.Include(p => p.ProfiloTitoloDiStudio).SingleOrDefaultAsync(p => p.IdProfilo== profiloinput.IdProfilo);

            _profiloDB.Nome= profiloinput.Nome;
            _profiloDB.Cognome= profiloinput.Cognome;


            _profiloDB.ProfiloTitoloDiStudio= profiloinput.ProfiloTitoloDiStudio;var x =await _dbcontext.SaveChangesAsync();}

I am not breaking any relationship between PROFILE and PROFILOTITOLODISTUDIO I am simply trying to make an update on the child table, the IDPROFILO foreign key in the profile object.ProfiloTitoloDiStudio is perfectly enhanced !!!

font-awesome-fonts error in .net core

$
0
0

Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/2.0 GET https://localhost:44368/fonts/fontawesome-webfont.eot? 

Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request finished in 7.9782ms 404 text/html

Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/2.0 GET https://localhost:44368/fonts/fontawesome-webfont.woff?v=4.7.0 

Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer:Error: Connection ID "18086456109425493791", Request ID "80000720-0001-fb00-b63f-84710c7967bb": An unhandled exception was thrown by the application.

Index is returning the view result after execution. But is followed by the above error.

What is the best way for asp.net core to make a cross-platform program?

$
0
0

These days I want to make a cross-platform program in the windows&linux system for using a socket to control a device.

With .Net it seems there are two ways: one is asp.net core, the other is Xamarin.

I have never learned Xamarin before so I am about to use asp.net to solve this.

As we know, we should wrap the page into a program no matter in Windows or Linux.

There are several ways: Electron/Webwindow.

In these articles:

https://blog.stevensanderson.com/2019/11/18/2019-11-18-webwindow-a-cross-platform-webview-for-dotnet-core/

Electron cost so much performance.

Webwindow still has some bugs and has not updated for a long time. And also, it is only a personal experimental project and no one knows whether it will be support in the future. 

I don't know what should I do now. Or I can only learn the Xamarin.

.Net 5 is coming soon while there is no information about which framework it will support for cross-platform.

I can hardly wait for the .Net5. Please give me a suggestion. Thank you.

AspNet Core 3.1 : No Manifest exist for the current culture

$
0
0
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;

namespace DemoApp
{
    [Produces("application/json")]
    [Route("api/[controller]")]
    public class TranslationsController : Controller
    {
        private readonly IStringLocalizer<SharedResource> _localizer;

        public TranslationsController(IStringLocalizer<SharedResource> localizer)
        {
            _localizer = localizer;
        }

        [HttpGet]
        public ActionResult List()
        {
            Dictionary<string, string> translations = _localizer.GetAllStrings().ToDictionary(x => x.Name, x => x.Value);
            return new JsonResult(translations);
        }
    }
}

I am getting error for this _localizer.GetAllStrings() in my aspnet core 3.1 application. I am having resx file with name ShareResource.resx in my resources folder

Looping through ViewData.ModelMetadata.Properties except for null values


Can i host asp.net in this platform.

$
0
0

Hi guys I recently started asp.net core development and now I'm finished and ready to launch my first website but I'm really confused about which hosting plan to buy. I found this hosting plan under my budget, not sure but I think it isLinux based, can you please tell me if I can host my asp.net core website here or not.

Link to site - https://www.hostinger.in/web-hosting

Also, I'm using ef core latest version and using SQL Server LocalDB.

I was thinking to buy the "premium web hosting" plan can you check this site and tell me whether I will be able to host here not.

Error when retrieving associated users using a join table and Microsoft Identity

$
0
0

I've facing an error that I am unsure of how to solve. I am trying to retrieve a list of users associated to an organization via a one to many join table. The error being thrown is:

Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.IEnumerable'. An explicit conversion exists (are you missing a cast?)

I cant seem to find a work around to this (and I'm teaching myself to code so my knowledge is limited).

Is anyone able to provide some direction on how to resolve this? The error itself is in the OrganizationsRepository on the 3rd last line:

return orgUsers;

IOrganizationsRepository:

using System.Collections.Generic;
using System.Threading.Tasks;
using Outmatch.API.Models;

namespace Outmatch.API.Data
{
    public interface IOrganizationRepository
    {
        void Add<T>(T entity) where T: class;
        void Delete<T>(T entity) where T: class;
        Task<bool> SaveAll();
        Task<IEnumerable<Organizations>> GetOrganizations();
        Task<Organizations> GetOrganization(int id);
        Task<OrgToLoc> GetOwnees(int OrganizationId, int LocationId);

        // Begin Help on many to many 
        // Get users attached to an organization
        Task<IEnumerable<User>> GetOrgUsers(int organizationId);
        // Get locations attached to an organization
        Task<IEnumerable<Organizations>> GetOrganizationNameById(int LocationId);
        // End many to many help
    }
}

OrganizationsRepository:

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Outmatch.API.Helpers;
using Outmatch.API.Models;

namespace Outmatch.API.Data
{
    public class OrganizationsRepository : IOrganizationRepository
    {
        private readonly DataContext _context;
        public OrganizationsRepository(DataContext context)
        {
            _context = context;

        }
        public void Add<T>(T entity) where T : class
        {
            _context.Add(entity);
        }

        public void Delete<T>(T entity) where T : class
        {
            _context.Remove(entity);
        }

        // get an organization only one of them).  Pass in the organization ID from the user interface, and pull the organization that corresponds to the 
        // id, returning it to the GUI 
        public async Task<Organizations> GetOrganization(int id)
        {
            var organization = await _context.Organization.FirstOrDefaultAsync(u => u.Id == id);
            return organization;

        }

        // Get the list of all organizations and return them to the GUI
        public async Task<IEnumerable<Organizations>> GetOrganizations()
        {
            var organizations = await _context.Organization.ToListAsync();
            return organizations;
        }

        public async Task<OrgToLoc> GetOwnees(int OrganizationId, int LocationId)
        {
            return await _context.LocationOwners.FirstOrDefaultAsync(u => u.OwnerId == OrganizationId && u.OwneeId == LocationId);
        }

        // Begin help many to many 
        public async Task<IEnumerable<Organizations>> GetOrganizationNameById(int LocationId)
        {
            var OrganizationName = await _context.Locations
                .Include(l => l.Owners)
                .Where(o => o.Id == LocationId)
                .SelectMany(l => l.Owners.Select(on => on.Owner))
                .ToListAsync();

            return OrganizationName;
        }
        // End help many to many 

        public async Task<bool> SaveAll()
        {
            return await _context.SaveChangesAsync() > 0;
        }

        public async Task<IEnumerable<User>> GetOrgUsers(int orgId)
    {
        var orgUsers = await _context.Organization
            .Include(u => u.UserId)
            .Where(u => u.Id == orgId)
            .SelectMany(u => u.UserId.Select(ui => ui.OrganizationId))
            .ToListAsync();

        return orgUsers;
    }
    }
}

UsersModel: 

using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;

namespace Outmatch.API.Models
{
    // List of properties for the User (Client) table in the db
    public class User : IdentityUser<int>
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public DateTime ActiveDate { get; set; }
        public DateTime EndDate { get; set; }

        // User Roles Management
        public virtual ICollection<UserRole> UserRoles { get; set; }

        // Organization to Client table ties
        public ICollection<OrgToClients> OrganizationId { get; set; }
    }
}

OrgToClients Model: 

namespace Outmatch.API.Models
{
    public class OrgToClients
    {
        public int OrganizationId { get; set; }
        public int UserId { get; set; }
        public User User { get; set; }
        public Organizations Organization { get; set; }
    }
}

Any assistance would be greatly appreciated.

.NET Core Jwt Token always expired when trying to access Authorized area

$
0
0

This is my Startup.cs

services.AddAuthentication(x =>{
    x.DefaultAuthenticateScheme="bearer";
    x.DefaultChallengeScheme="bearer";}).AddJwtBearer("bearer",x =>{
    x.RequireHttpsMetadata=false;
    x.SaveToken=true;//x.TokenValidationParameters = tokenValidationParameters;
    x.TokenValidationParameters=newTokenValidationParameters{ValidateIssuerSigningKey=true,IssuerSigningKey=newSymmetricSecurityKey(Encoding.UTF8.GetBytes("SecretKey")),ValidateIssuer=true,ValidateAudience=true,ValidateLifetime=true,ValidIssuer=Environment.GetEnvironmentVariable(MS_Jwt_Issuer),ValidAudience=Environment.GetEnvironmentVariable(MS_Jwt_Issuer),ClockSkew=TimeSpan.Zero,};
    x.Events=newJwtBearerEvents{OnAuthenticationFailed= context =>{if(context.Exception.GetType()==typeof(SecurityTokenExpiredException)){
                context.Response.Headers.Add("Token-Expired","true");}returnTask.CompletedTask;}};});


services.AddResponseCaching();
services.AddCors(c =>{
    c.AddPolicy("AllowOrigin", options => options.AllowAnyOrigin());});

This is how I set the token:

var key =newSymmetricSecurityKey(Encoding.UTF8.GetBytes("SecretKey"));var credentials =newSigningCredentials(key,SecurityAlgorithms.HmacSha256);var tokenDescriptor =newSecurityTokenDescriptor{Subject=newClaimsIdentity(claims),Expires=DateTime.UtcNow.AddDays(10),SigningCredentials= credentials,IssuedAt=DateTime.UtcNow,Issuer=Environment.GetEnvironmentVariable(MS_Jwt_Issuer),Audience=Environment.GetEnvironmentVariable(MS_Jwt_Issuer),};var token = tokenHandler.CreateToken(tokenDescriptor);var refreshToken = tokens.GenerateRefreshToken();var processedToken = tokenHandler.WriteToken(token);

Whenever I authenticate, I am able to get a token out properly. However, when I try to access a class protected by [Authorize], I get this exception:

Exception thrown: 'Microsoft.IdentityModel.Tokens.SecurityTokenExpiredException' in Microsoft.IdentityModel.Tokens.dll

Here is a sample of my token. It verifies successfully with my secret key and the expiry date shown is proper and not expired:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJQaG9uZU51bWJlciI6IjEyMzIxMjMxMjMiLCJuYmYiOjE1ODcwNTAxOTksImV4cCI6MTU4NzkxNDE5OSwiaWF0IjoxNTg3MDUwMTk5LCJpc3MiOiJTUiIsImF1ZCI6IlNSIn0.WbEJq_PAOLvra1ZUwtQEKH9FRBDdb2byw26miUm-k-E

EDIT:

When I try to manually validate the token, it verifies successfully and it is not Expired. But for some reason, the [Authorize] labels it as expired

existing php and mysql --- asp.net core CRUD required

$
0
0

dear all,

i have a php and mysql environment in Godaddy. I would like to create online applications - so that people can fill their form and submit their queries for admission. Maybe second line will be integrating to payment site etc.

I thought a simple approach will be to create asp.net core application and integrate with php mysql site.

any response will be helpful for me to go forward.

Warm Regards,

Sathya

Help Needed in xml File reference

$
0
0

Hi,

I am working in asp.net core 2.2. i using swagger for documentation and am able to configure and make it work. i am having one issue. i have included the xml comments  for the propertied in of my class and its located in different class library project. i have referenced this class library assembly of my asp.net core api project.  but how do i refer the xml file which is getting generated in my class library project? when i run the api, i can't see the swagger document. 

To test it,  i copied the xml file manually to the AppContext.BaseDirectory location, its showing. But i want this to happen automatically. please help me on referencing the class library project generated xml file in api project automatically. 

for example

services.AddSwaggerGen(c =>
{
    c.SwaggerDoc("v1", info);
    var filePath = $"{Assembly.GetExecutingAssembly()
.GetName().Name}.xml";
    filePath = Path.Combine(AppContext.
BaseDirectory, xmlFile);
    c.IncludeXmlComments(filePath);
});

the above code will picks the xml file which is build from the asp.net core project base directory. on my case, the xml file location is  different. i mans the class library project location is different folder. only one option i can think of.  the build path of the xml file can be given to the asp.net core project base directory. so whenever we build the  class library project, it will gets copied to web project. is there any other way around?

Help needed in Passing a method in Typeof()

$
0
0

Hi,

I am using swagger for my asp.net core 2.2 documentation and for displaying the response model, i have to use[ProducesResponseType(typeof(ResponseObject), 200)].

In my case, i am not directly returning the Response object. I have a static method which takes the output object as paramater and constructs the ResponseObject.  Details Below,

//Model.cs

Public class UserResponse
{
   public  int UserId { get; set; }
   public  string UserMessage{ get; set; }
}

//Controller.cs

 [Consumes("application/json")]
        [ProducesResponseType(typeof(APIResponse), 200)]

public IActionResult GetUser(string UserName)
        {
         
UserResponse userResponse = dbService.GetUser(UserName);
if(userResponse.UserId > 0)
{
	return Ok(Utility.ConstructResponse(userResponse
                            , Utility.ConstructMessage(1000, "Success"));
}

}
public static class Utility
    {
public static APIResponse ConstructResponse(object objResult,Message message)
        {
            APIResponse baseResponse = new APIResponse();
            TResponse tResponse = new TResponse(System.Net.HttpStatusCode.OK);
            tResponse.TMessage = message;
            tResponse.Result = objResult;
            baseResponse.TResponse = tResponse;
            return baseResponse;
        }
        public static Message ConstructMessage(short Code, string Description)
        {
            return  new Message { Code = Code, Description = Description };
        }
}

So,if i use [ProducesResponseType(typeof(APIResponse), 200)] i am getting the model on the swagger when i lunch the api documentation, The Result object is empty as follows
{"TResponse": {"Version": "string","StatusCode": "Continue","Result": {},"TMessage": {"Code": 0,"Description": "string"
    }
  }
}

<div> </div> <div>Expected Sample output Response Should be </div>

{"TResponse": {"Version": "string","StatusCode": "Continue","Result": {"UserId": 0,"UserMessage": "string"
               },"TMessage": {"Code": 0,"Description": "string"
    }
  }
}

I am not sure how to pass the method in typeof(). Any suggestion how to make the url response like this in the swagger documentation. Any help will be highly appreciated. 

.Net Core : Accessing Controller 1 from Controller 2

$
0
0

Any example to access the HTTP Get async Task method from controller 1 into controller 2 in asp.net core ?


Page Routing based on a custom value

$
0
0

Hello:

I need to authorize MVC pages based on a combination of custom values that I obtain from the user logged in, for example:

A logged in user will see a certain page(s) if they have a code value of "ABCD" that I generate from querying certain values from their extension attributes. If the code value is "WXYZ" then they will see another page.

Thanks.

Why my application does not consume CPU and RAM?

$
0
0

I have a solution in asp.net-core 3.1. When I run stress testing, it consumes no more than 20-30% cpu.
I have tried increasing worker processes but still it gives a constant throughput and does not consume resources.
Any suggestion on what I am doing wrong here?

System Specs:
OS: Windows server 2012
CPU: 16 cores
RAM: 64 GB

Include In UserManager Asp.Net Core

$
0
0

Hi,
my Asp.NetUsers table is related with Customer table and other tables (one to one)

i want use this code _userManager.GetUsersInRoleAsync("Customer")  to get customer users but i want set include to customer table.

how can i use include in _userManager.GetUsersInRoleAsync to get users and include with other tables     

Reusable button - Custom tag helper?

$
0
0

I have this button on about a dozen of my pages:

<button type="button" class="btn btn-outline-primary btn-back" onclick="location.href='/Controller/Action'">Button text</button>

The text of the button will change along with the link but everything else should be the same.  Some options I'm thinking about doing are:

  1. Just writing the html  ~12 times.  
  2. Putting something like this in my _layout page:
@if (ViewBag.Button != null)
{<button type="button" class="btn btn-outline-primary btn-back" onclick="location.href='@ViewBag.ButtonLink'">@ViewBag.Button</button>
}

3. Creating a custom tag helper for it

4. ???

What would you do?  

404 Error on Deployment

$
0
0

Hello everyone and thanks for the help in advance.  I'm brand new to .Net core and am just trying to get acquainted with basics.  I am working on Visual Studio 2019 on Windows 10 Professional environment.  I opened a new MVC application and took the default application which runs perfectly fine on the development machine.  I then installed .Net Core 3.1.3 hosting bundle on my Windows Server 2012 R2 running IIS 8.0.  I do not have the server set up for publishing directly to it, so I tried following the tutorial https://docs.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-3.1&tabs=visual-studio.  I copied the contents of the bin\Release\netcoreapp3.1 directory into the application root.  I then tried browsing to http://localhost/index, but receive the 404 error.  Seems likely I have the deployment incorrect, but I'm not sure where to go from here.  Any help would be appreciated.

Viewing all 9386 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>