Activities of "VivekKoppula"

Hi Maliming, Thats the issue, Thanks.

I created a starter Balzor Server project and ran in two scenerios. The two scenerios differ only in the fact that the ASPNETCORE_ENVIRONMENT is different. In one case its 'Development', and in the other case its 'DevelopmentTwo', anything other then 'Development'

First the necessary details are as follows.

The dotnet version is 6.0.100-rc.2.21505.57 ABP version is 4.4.3 (Stable)

UI Type is Blazor Server. No Preview(Its just .net 5)

DB Provide: Ef Core

Tiered (MVC) or Identity Server Separated (Angular): No

Now the two scenerios.

I am running the blazor app running on my localhost.

In the scenerio one, I connect to the local db database on my local machine. The ASPNETCORE_ENVIRONMENT is 'Development'. For this I selected the IIS Express profile which looks as follows in launchSettings.json.

"IIS Express": {
	  "commandName": "IISExpress",
	  "launchBrowser": true,
	  "environmentVariables": {
		"ASPNETCORE_ENVIRONMENT": "Development"
	  }
	},
    

I created settings file named it appsettings.Development.json. Its contents are as follows.

{
  "ConnectionStrings": {
	"Default": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BvhHrSita;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
  },
  "SomeVar": "Development Env"
}

I modified the CreateHostBuilder method in the Program.cs file as follows to include the appsettings.development.json file.

    public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureAppConfiguration(build =>
            {

                var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");

                build.AddJsonFile("appsettings.secrets.json", optional: false);
                build.AddJsonFile("appsettings.json", optional: false);
                build.AddJsonFile($"appsettings.{env}.json", optional: false);
            })
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
            })
            .UseAutofac()
            .UseSerilog();
            

In this scenerio, the app works fine as expected.

In the scenerio two, everything is same except the ASPNETCORE_ENVIRONMENT is anything other than 'Development', I choose 'DevelopmentTwo'. To create this scenerio I did the following.

First I made a copy of appsettings.Development.json and named it appsettings.DevelopmentTwo.json. Its contents are as follows.

{
  "ConnectionStrings": {
	"Default": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=BvhHrSita;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
  },
  "SomeVar": "Developemnt Two Env"
}

The Connection String is exactly same, only the SomeVar is now as you can see Development Two Env.

Also I added a new profile in launchSettings.json as follows to help me set env var ASPNETCORE_ENVIRONMENT to DevelopmentTwo as follows.

"IISExpressDevTwo": {
  "commandName": "IISExpress",
  "launchBrowser": true,
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "DevelopmentTwo"
  }
},

Here again, the only diff is ASPNETCORE_ENVIRONMENT which is DevelopmentTwo.

Now when I run this profile, the app does not run properly.

If I press F12 to look at the console, I see the following mesages.

DevTools failed to load source map: Could not load content for https://localhost:44313/__bundles/toastr.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://localhost:44313/__bundles/bootstrap.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE	

I added a few lines of code to the ConfigureServices Method in BlazorModule.cs file to know exactly which profile is being loaded and what the evn var is as follows. This is just for debugging, and not required for reproducing the issue.

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        var hostingEnvironment = context.Services.GetHostingEnvironment();
        var configuration = context.Services.GetConfiguration();

        var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
        var envName = hostingEnvironment.EnvironmentName;
        var connString = configuration.GetConnectionString("Default");
        //configuration

        var myValue = configuration.GetValue<string>("SomeVar");


        ConfigureUrls(configuration);
        

So now when I launch the app, I see the following

If I select the earlier profile, where the ASPNETCORE_ENVIRONMENT is just Development and not DevelopmentTwo, I see the following as I launch the app.

So as you can see the the only difference is ASPNETCORE_ENVIRONMENT.

In summary, when ever ASPNETCORE_ENVIRONMENT is anything other then Development, the app would not run properly. The F12 shows the following.

DevTools failed to load source map: Could not load content for https://localhost:44313/__bundles/toastr.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://localhost:44313/__bundles/bootstrap.min.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE	

And when I see the logs, I see an exception like the following(when the ASPNETCORE_ENVIRONMENT is anything other then Development).

2021-10-24 18:12:09.000 +05:30 [DBG] Added 0 entity changes to the current audit log
2021-10-24 18:12:09.020 +05:30 [ERR] An unhandled exception has occurred while executing the request.
Volo.Abp.AbpException: Could not find file '/_content/Blazorise/blazorise.css'
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.GetFileInfo(IBundlerContext context, String file)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.GetAndMinifyFileContent(IBundlerContext context, String fileName)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.GetFileContentConsideringMinification(IBundlerContext context, String fileName)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundlerBase.Bundle(IBundlerContext context)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleManager.<>c__DisplayClass16_0.<GetBundleFilesAsync>b__0()
   at System.Collections.Generic.AbpDictionaryExtensions.&lt;&gt;c__DisplayClass7_0`2.<GetOrAdd>b__0(TKey k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at System.Collections.Generic.AbpDictionaryExtensions.GetOrAdd[TKey,TValue](ConcurrentDictionary`2 dictionary, TKey key, Func`1 factory)
   at Volo.Abp.AspNetCore.Mvc.UI.Bundling.BundleCache.GetOrAdd(String bundleName, Func`1 factory)

Something is fishy with respect to bundling. But when the env var is ASPNETCORE_ENVIRONMENT is Development things run fine.

Hope that I am not missing something trivial here and you will be able to reproduce this. Any advice is appreciated. Let me know if you need any details further.

I suggest take a look at this bug that I created first and then come here.

I created a starter Balzor Server project and deployed it to Azure. While it looks fine on local mcahine, something is wrong when ran on Azure.

The details are as follows.

The dotnet version is 6.0.100-rc.2.21505.57 ABP version is 4.4.3 (Stable)

UI Type is Blazor Server.

DB Provide: Ef Core

Tiered (MVC) or Identity Server Separated (Angular): No

First I created necessary resources on Azure, Web App Service and also backend Database.

I applied the migrations on the created database using the migrator project.

Then created a env var on the app service as follows.

Now I generated the app on .net 5(no preview, and not .net 6), and next in the code, I added a appsettings.Production.json file for production database(on azure) connection string.

Now I deployed the app from Visual Studio Publish as follows.

Finally the problem.

I launch the website running on Azure, the home page looks fine. I click the login link to get to the login page. This is also fine.

Once I login, the home page now looks differet, and here is the problem.

The left menu does not have the Saas and Administration menu items.

On the right, the admin does not appear, but you can click it.

When I pressed F12, I saw this message, but it seems there is no relevance to the problem at hand.

DevTools failed to load source map: Could not load content for https://bvhhrsitawebsitedev.azurewebsites.net/__bundles/toastr.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

I felt there is some problem with bundling, and so I commented out the following code to diable the bundling and then redeployed. But the problem remained.

While My Account page looks fine as I navigate to it, the tenants page on the other hand has a different problem.

Authorization Failed, Given policy has not granted.

Other pages also show errors.

Hope I am not missing something trival.

Hi,

Yes you need to just create a preview project. Blazor Server App. Let me know, if you need detailed steps, I will post them tomorrow.

Thanks and Regards Vivek

I created a new Blazor Server(Not Web Assembly) app and I get the following error as I run the app.

Sometimes it works, but most f the times, I am getting this error.

The dotnet version is 6.0.100-rc.2.21505.57 ABP version is 4.4.3 (Stable)

  • DB provider: Its EF Core with Sql
  • Tiered (MVC) or Identity Server Separated (Angular): no

Let me know, If you need any further details.

I used preview checkbox so the latest is used. I am keen for the preview because hot reloading is supported in .net 6, and with blazor server(not web assembly) and I have also the latest VS 2022 Preview 5. So a typical csproj file looks like this.

	  <PropertyGroup>
		<TargetFramework>net6.0</TargetFramework>
		<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
		<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
		<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
		<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
		<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
		<PreserveCompilationReferences>true</PreserveCompilationReferences>
	  </PropertyGroup>

	  <ItemGroup>
		<PackageReference Include="AspNetCore.HealthChecks.UI" Version="5.0.1" />
		<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
		<PackageReference Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="5.0.1" />
		<PackageReference Include="Serilog.AspNetCore" Version="4.0.0" />
		<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
		<PackageReference Include="Blazorise.Bootstrap" Version="0.9.4.1" />
		<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.4.1" />
		<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="6.0.0-rc.*" />
		<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="6.0.0-rc.*" />
		<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="6.0.0-rc.*" />
	  </ItemGroup>

	  <ItemGroup>
		<ProjectReference Include="..\Bvh.HrSita.Application\Bvh.HrSita.Application.csproj" />
		<ProjectReference Include="..\Bvh.HrSita.HttpApi\Bvh.HrSita.HttpApi.csproj" />
		<ProjectReference Include="..\Bvh.HrSita.EntityFrameworkCore\Bvh.HrSita.EntityFrameworkCore.csproj" />
		<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.Swashbuckle" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.AspNetCore.Components.Server.LeptonTheme" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.Account.Pro.Public.Web.IdentityServer" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.Account.Pro.Admin.Blazor.Server" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.AuditLogging.Blazor.Server" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.Identity.Pro.Blazor.Server" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.LeptonTheme.Management.Blazor.Server" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.IdentityServer.Blazor.Server" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.LanguageManagement.Blazor.Server" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Saas.Host.Blazor.Server" Version="5.0.0-beta.1" />
		<PackageReference Include="Volo.Abp.TextTemplateManagement.Blazor.Server" Version="5.0.0-beta.1" />
	  </ItemGroup>

The logs look below.

2021-10-17 12:17:34.118 +05:30 [INF] Authorization failed. These requirements were not met:
		PermissionRequirement: LeptonThemeManagement.Settings
		2021-10-17 12:17:34.121 +05:30 [INF] Authorization failed. These requirements were not met:
		PermissionRequirement: LeptonThemeManagement.Settings
		2021-10-17 12:17:34.389 +05:30 [WRN] Unhandled exception rendering component: Undefined permission: IdentitySer�
		Volo.Abp.AbpException: Undefined permission: IdentitySer�
		   at Volo.Abp.Authorization.Permissions.PermissionDefinitionManager.Get(String name)
		   at Volo.Abp.Authorization.Permissions.PermissionChecker.IsGrantedAsync(ClaimsPrincipal claimsPrincipal, String[] names)
		   at Volo.Abp.Authorization.Permissions.PermissionChecker.IsGrantedAsync(String[] names)
		   at Volo.Abp.Authorization.Permissions.RequirePermissionsSimpleBatchStateChecker`1.IsEnabledAsync(SimpleBatchStateCheckerContext`1 context)
		   at Volo.Abp.SimpleStateChecking.SimpleStateCheckerManager`1.IsEnabledAsync(TState[] states)
		   at Volo.Abp.UI.Navigation.MenuManager.CheckPermissionsAsync(IServiceProvider serviceProvider, IHasMenuItems menuWithItems)
		   at Volo.Abp.UI.Navigation.MenuManager.GetInternalAsync(String name)
		   at Volo.Abp.UI.Navigation.MenuManager.GetAsync(String[] menuNames)
		   at Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components.ApplicationLayout.Navigation.MainMenuProvider.GetMenuAsync()
		   at Volo.Abp.AspNetCore.Components.Web.LeptonTheme.Components.ApplicationLayout.MainHeader.MainHeader.OnInitializedAsync()
		   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
		   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
		2021-10-17 12:17:34.395 +05:30 [ERR] Unhandled exception in circuit 'dIVgARWqvTUNtLj0M2vYqV8hgjEwCDp1me3m7bVpJdE'.
        
        
		2021-10-17 12:19:03.476 +05:30 [INF] Request starting HTTP/2 POST https://localhost:44313/_blazor/disconnect multipart/form-data;+boundary=----WebKitFormBoundarya2fTLzwEz9Z9ylvJ 359
		2021-10-17 12:19:03.496 +05:30 [INF] No CORS policy found for the specified request.
		2021-10-17 12:19:03.497 +05:30 [INF] Executing endpoint 'Blazor disconnect'
		2021-10-17 12:19:03.500 +05:30 [INF] Executed endpoint 'Blazor disconnect'
		2021-10-17 12:19:03.502 +05:30 [INF] Request finished HTTP/2 POST https://localhost:44313/_blazor/disconnect multipart/form-data;+boundary=----WebKitFormBoundarya2fTLzwEz9Z9ylvJ 359 - 200 - - 25.3870ms

Thank You. It worked finally.

Hi @EngincanV,

Looks like I am missing something trival here.

Started afresh, I cloned the latest, and then ran the app. Built a new workflow from UI and for the HttpRequest activity, set the end point as

hello-welcome, see the screen shot below. Then navigated to https://localhost:44336/hello-welcome. But its still not working.

But when I navigate to https://localhost:44336/hello-world, it works fine(see the screen shot below). The is due the coded workflow already present and running. But the UI one is not.

Can you please check from your side, and if its working, can you please export the jaso file and attach it along with the project files so that I can download the same to test from my side?

Thank You.

This is a follow upto this question

I am trying to add swagger support by doing the following.

  1. Added the following line of code the web module.

    context.Services.AddElsaApiEndpoints(); // The following is throwing exception context.Services.AddElsaSwagger();

But it is throwing exception. The exception is shown below for your reference. So I had to comment out.

  1. Also tried to add the following code in the same ElsaDemoWebModule.cs file.

    app.UseAbpSwaggerUI(options => { options.SwaggerEndpoint("/swagger/v1/swagger.json", "ElsaDemo API"); // The following did not help. options.SwaggerEndpoint("/swagger/v1/swagger.json", "Elsa"); });

But it did help. I get Elsa in the drop down, but selecting it does not give the elsa swagger UI.

The full exception is as follows.

An unhandled exception occurred while processing the request. ArgumentException: An item with the same key has already been added. Key: v1 System.Collections.Generic.Dictionary<TKey, TValue>.TryInsert(TKey key, TValue value, InsertionBehavior behavior)

DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions`1[Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions], System.IServiceProvider, Microsoft.AspNetCore.Hosting.IWebHostEnvironment)' on type 'ConfigureSwaggerGeneratorOptions'. Autofac.Core.Activators.Reflection.BoundConstructor.Instantiate()

DependencyResolutionException: An exception was thrown while activating Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator -> λ:Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorOptions -> Microsoft.Extensions.Options.OptionsManager1[[Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorOptions, Swashbuckle.AspNetCore.SwaggerGen, Version=6.1.4.0, Culture=neutral, PublicKeyToken=d84d99fb0135530a]] -> Microsoft.Extensions.Options.OptionsFactory1[[Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorOptions, Swashbuckle.AspNetCore.SwaggerGen, Version=6.1.4.0, Culture=neutral, PublicKeyToken=d84d99fb0135530a]] -> λ:Microsoft.Extensions.Options.IConfigureOptions`1[[Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorOptions, Swashbuckle.AspNetCore.SwaggerGen, Version=6.1.4.0, Culture=neutral, PublicKeyToken=d84d99fb0135530a]][] -> Swashbuckle.AspNetCore.SwaggerGen.ConfigureSwaggerGeneratorOptions. Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action<ResolveRequestContext> next)

I tried the abp elsa demo example available at github after following this post.

Things look fine for the coded workflows defined within the workflows folder.

But then I created a simple workflow from the UI as follows. This did not work.

You can create the same workflow by exporting the json(pasted at the end below) file as follows.

After ensuring that it is published, when I run it, it simply shows the elsa workflow page instead of Hello Everyone text reponse.

I tried the same get requst with postman and the result is the same _Host page.

Note that the coded http workflow works fine.

I felt this has got to do with routing, and tried commenting out the following line.

app.UseConfiguredEndpoints(endpoints =>
{
    //endpoints.MapFallbackToPage("/_Host");
});

But this shows 404 not found.

I dont know what to do now. Can you please help me?

You can import the following Json to created the workflow in the ui.

{
  "$id": "1",
  "definitionId": "2d3efd5f41d54f1aafd6772fead4c916",
  "versionId": "73cad85d8a3044ccb21a80d7804c555d",
  "name": "SimpleHelloWorld",
  "displayName": "Simple Hello World",
  "description": "Simple Http workflow created from UI. For a http get request to elsa-hello-world, this returns a simple http text reponse",
  "version": 1,
  "variables": {
	"$id": "2",
	"data": {}
  },
  "customAttributes": {
	"$id": "3",
	"data": {}
  },
  "isSingleton": false,
  "persistenceBehavior": "WorkflowBurst",
  "deleteCompletedInstances": false,
  "isPublished": false,
  "isLatest": true,
  "activities": [
	{
	  "$id": "4",
	  "activityId": "c976ee95-cb57-4fd3-b586-0268cb134025",
	  "type": "HttpEndpoint",
	  "displayName": "HTTP Endpoint",
	  "persistWorkflow": false,
	  "loadWorkflowContext": false,
	  "saveWorkflowContext": false,
	  "persistOutput": false,
	  "properties": [
		{
		  "$id": "5",
		  "name": "Path",
		  "expressions": {
			"$id": "6",
			"Literal": "elsa-hello-world"
		  }
		},
		{
		  "$id": "7",
		  "name": "Methods",
		  "expressions": {
			"$id": "8",
			"Json": "[\"GET\"]"
		  }
		},
		{
		  "$id": "9",
		  "name": "ReadContent",
		  "expressions": {
			"$id": "10"
		  }
		},
		{
		  "$id": "11",
		  "name": "TargetType",
		  "expressions": {
			"$id": "12"
		  }
		}
	  ]
	},
	{
	  "$id": "13",
	  "activityId": "9c9faf81-febb-487b-a3c6-6aa87dc7c197",
	  "type": "WriteHttpResponse",
	  "displayName": "HTTP Response",
	  "persistWorkflow": false,
	  "loadWorkflowContext": false,
	  "saveWorkflowContext": false,
	  "persistOutput": false,
	  "properties": [
		{
		  "$id": "14",
		  "name": "StatusCode",
		  "expressions": {
			"$id": "15"
		  }
		},
		{
		  "$id": "16",
		  "name": "Content",
		  "expressions": {
			"$id": "17",
			"Literal": "Hello Everyone"
		  }
		},
		{
		  "$id": "18",
		  "name": "ContentType",
		  "expressions": {
			"$id": "19"
		  }
		}
	  ]
	}
  ],
  "connections": [
	{
	  "$id": "20",
	  "sourceActivityId": "c976ee95-cb57-4fd3-b586-0268cb134025",
	  "targetActivityId": "9c9faf81-febb-487b-a3c6-6aa87dc7c197",
	  "outcome": "Done"
	}
  ],
  "id": "73cad85d8a3044ccb21a80d7804c555d"
}

I created an asp.net mvc web app using abp suite with the following options.

Template Type: Application Template UI Framework: MVC Database provider: Entity Framework Core Database management system: SQLServer Public web site: Not checked Seperate tenant schema: Not checked Tiered: Not checked

Whenever an exception is thrown, it simply swallows it. Is there any setting that I am missing?

In contrast to this, ealier a few months back, I created an angular app with Abp Community, and whenever the code throws and exception, the UI shows a friendly message.

Is there any setting that I am missing in the asp.net mvc app?

The options choosen when creating asp.net mvc app with Abp suite are as follows.

Showing 1 to 10 of 16 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11