Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "ervingayle"

I recently upgraded from v5.0 to v7.0 and it was quite a task. Everything seems to be loading fine. However swagger is giving me an error and I cannot figure out how to fix it. The contents of teh Logs.txt file is below: System.ArgumentException: Type provided must be an Enum. Parameter name: enumType at System.RuntimeType.GetEnumNames() at System.Enum.GetNames(Type enumType) at Enotch.EnotchVnext.Web.Swagger.SwaggerEnumParameterFilter.AddEnumSpec(Dictionary2 extensions, Type type, ISchemaRegistry schemaRegistry) at Enotch.EnotchVnext.Web.Swagger.SwaggerEnumParameterFilter.Apply(IParameter parameter, ParameterFilterContext context) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateParameter(ApiDescription apiDescription, ApiParameterDescription apiParameterDescription, ISchemaRegistry schemaRegistry) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.<>c__DisplayClass11_0.<CreateParameters>b__1(ApiParameterDescription paramDesc) at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateParameters(ApiDescription apiDescription, ISchemaRegistry schemaRegistry) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreateOperation(ApiDescription apiDescription, ISchemaRegistry schemaRegistry) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItem(IEnumerable1 apiDescriptions, ISchemaRegistry schemaRegistry) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.<>c__DisplayClass6_0.<CreatePathItems>b__2(IGrouping2 group) at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.CreatePathItems(IEnumerable1 apiDescriptions, ISchemaRegistry schemaRegistry) at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath, String[] schemes) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.<Invoke>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.<Invoke>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at IdentityServer4.Hosting.IdentityServerMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at IdentityServer4.Hosting.BaseUrlMiddleware.<Invoke>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Abp.AspNetZeroCore.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()

Do you have any error log output that you can share? This is important to assist you with any way.

Regarding the dependency warnings there is a restore packages on build option. That may assist you as well. I had this issue at first.

In your Web.Core project add the following line: //Enable multi clock support Clock.Provider = ClockProviders.Utc;

Please note that it is Web.Core and NOT Web.Mvc. This works for me using v4.4 with .net core & jquery.

I think with every major version release there will be needed changes even with the nuget approach. I believe that the ease of referencing certain components within Abp and accessing the source code will change somehow if the upgrade paths were automated. I am in favor of its current design.

While I may not be leveraging Abp for as long as other members on the forum, my environment has been successfully upgraded from 4.1 to 4.2 to 4.3 and 4.4 versions successfully leveraging Visual Studio TS and Master / DEV branches. Its really not as hard as everyone thinks for the core projects and files. If you are not using branching then yes it will be a nightmare.

Would love to share experiences with anyone who may need it via Skype or Teamviewer.

Unfortunately, I am using .net core (Full Framework) with jQuery. I am on version 4.4 at the moment. Will wait until the next version to upgrade to the latest release as I would like to test the IdentityServer integration

Thanks for your reply. The startup.cs in the .net core version has two Configure methods. I have uncommneted the Hangfire lines in each and then one by one and did not have success but maybe I am missing something as you mentioned. Here is the complete file.

#if FEATURE_SIGNALR using Owin; using Abp.Owin; using ProjectName.Web.Owin; #endif

namespace ProjectName.Web.Startup { public class Startup { private readonly IConfigurationRoot _appConfiguration;

    public Startup(IHostingEnvironment env)
    {
        _appConfiguration = env.GetAppConfiguration();
    }

    public IServiceProvider ConfigureServices(IServiceCollection services)
    {
        //MVC
        services.AddMvc(options =>
        {
            options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
        });

        IdentityRegistrar.Register(services, "Application");

        //Identity server
        if (bool.Parse(_appConfiguration["IdentityServer:IsEnabled"]))
        {
            IdentityServerRegistrar.Register(services, _appConfiguration);
        }

        //Swagger - Enable this line and the related lines in Configure method to enable swagger UI
        services.AddSwaggerGen(options =>
        {
            options.SwaggerDoc("v1", new Info { Title = "EnotchVnext API", Version = "v1" });
            options.DocInclusionPredicate((docName, description) => true);
        });

        //Recaptcha
        services.AddRecaptcha(new RecaptchaOptions
        {
            SiteKey = _appConfiguration["Recaptcha:SiteKey"],
            SecretKey = _appConfiguration["Recaptcha:SecretKey"]
        });

        //Hangfire (Enable to use Hangfire instead of default job manager)
        services.AddHangfire(config =>
        {
            config.UseSqlServerStorage(_appConfiguration.GetConnectionString("Default"));
        });

        services.AddScoped&lt;IWebResourceManager, WebResourceManager&gt;();

        //Configure Abp and Dependency Injection
        return services.AddAbp&lt;EnotchVnextWebMvcModule&gt;(options =>
        {
            //Configure Log4Net logging
            options.IocManager.IocContainer.AddFacility&lt;LoggingFacility&gt;(
                f => f.UseAbpLog4Net().WithConfig("log4net.config")
            );
        });
    }

    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
    {
        //Initializes ABP framework.
        app.UseAbp(options =>
        {
            options.UseAbpRequestLocalization = false; //used below: UseAbpRequestLocalization
        });

        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        else
        {
            app.UseDeveloperExceptionPage();
            //Commented error pages
            //app.UseStatusCodePagesWithRedirects("~/Error?statusCode={0}");
            //app.UseExceptionHandler("/Error");
        }

        AuthConfigurer.Configure(app, _appConfiguration);

        app.UseStaticFiles();

        app.UseAbpRequestLocalization();

#if FEATURE_SIGNALR //Integrate to OWIN app.UseAppBuilder(ConfigureOwinServices); #endif

        //Hangfire dashboard & server (Enable to use Hangfire instead of default job manager)
        app.UseHangfireDashboard("/hangfire", new DashboardOptions
        {
            Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard) }
        });
        app.UseHangfireServer();

        app.UseMvc(routes =>
        {
            routes.MapRoute(
                name: "defaultWithArea",
                template: "{area}/{controller=Home}/{action=Index}/{id?}");

            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
        });

        // Enable middleware to serve generated Swagger as a JSON endpoint
        app.UseSwagger();
        //Enable middleware to serve swagger - ui assets(HTML, JS, CSS etc.)
        app.UseSwaggerUI(options =>
        {
            options.SwaggerEndpoint("/swagger/v1/swagger.json", "EnotchVnext API V1");
        }); //URL: /swagger
    }

#if FEATURE_SIGNALR private static void ConfigureOwinServices(IAppBuilder app) { app.Properties["host.AppName"] = "EnotchVnext";

        app.UseAbp();

        app.MapSignalR();

        //Enable it to use HangFire dashboard (uncomment only if it's enabled in EnotchVnextWebCoreModule)
        //app.UseHangfireDashboard("/hangfire", new DashboardOptions
        //{
        //    Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard) }
        //    //Authorization = new[] { new AbpHangfireAuthorizationFilter() }
        //});
    }

#endif } }

As a test have you tried to DisableValidation on the controller method? <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Validating-Data-Transfer-Objects">https://aspnetboilerplate.com/Pages/Doc ... er-Objects</a>

Also on the views do you have an AntiForgeryToken? Something like: @Html.AntiForgeryToken()

I had similar issues with my jQuery forms but not specific to the 4.4 upgrade rather from aspnetboilerplate.

I did some more research and I am not clear now the aspnet environment variable is being read/referenced.

There is a Microsoft article that references add the setting to your web.config as follows and this seems to work so far. <environmentVariables> <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" /> </environmentVariables>

I installed the Web Essentials plug-in and used the bundle and minify option there. My only issue here is that when the .min.js files are created, the files do not show in the bower folder path for that plug-in when the bower packages are stored upon project startup.

Hello,

I have not upgraded the hangfire packages.

It is the one which comes with AspNet Zero.

Showing 11 to 20 of 37 entries