question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Connection id "0HLF65M4A0D4I", Request id "0HLF65M4A0D4I:0000000E": An unhandled exception was thrown by the application

See original GitHub issue

I downloaded the ABP version 3.7.2 and ran it for the first time without adding any entity and it worked fine as expected. However, when I added some entities, It does not start! I checked the error log and noticed the error Connection id "0HLF65M4A0D4I", Request id "0HLF65M4A0D4I:0000000E": An unhandled exception was thrown by the application Below is the entity I added in the Bank.Core project. I created a new folder (Transactions) to match my entity name Transaction which contains foreign keys. See below.

using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Bank.Authorization.Users;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Bank.Transactions
{
    [Table("Tbl_Transactions")]
    public class Transaction : Entity<long>, IHasCreationTime
    {
        /// <summary>
        /// Maximum User's account number length
        /// </summary>
        public const int MaxAccountNumberLength = 10;

        public enum Currency
        {
            NGN = 566,
            USD = 840,
            EUR = 978
        }

        public DateTime CreationTime { get; set; }
        public Investment Investment { get; set; }
        public bool IsCompleted { get; set; }

        public Loan Loan { get; set; }
        public User User { get; set; }
    }
}

The Loan entity is as follows

using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Bank.Transactions
{
    [Table("Tbl_Loans")]
    public class Loan : Entity<long>, IHasCreationTime
    {
        [StringLength(Transaction.MaxAccountNumberLength)]
        public string AccountNumber { get; set; }

        public decimal? Amount { get; set; }
        public DateTime CreationTime { get; set; }
        public DateTime? EffectiveDate { get; set; }
        public DateTime? InstallmentDate { get; set; }
        public decimal? InterestRate { get; set; }
        public decimal? ManagementFee { get; set; }
        public DateTime? MaturityDate { get; set; }
        public decimal? ProcessingFee { get; set; }
        public decimal? RepaymentAmount { get; set; }
        public int? Tenor { get; set; }
    }
}

And the Investment Entity as follows

using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Bank.Transactions
{
    [Table("Tbl_Investments")]
    public class Investment : Entity<long>, IHasCreationTime

    {
        [StringLength(Transaction.MaxAccountNumberLength)]
        public string AccountNumber { get; set; }

        public decimal? Amount { get; set; }
        public DateTime CreationTime { get; set; }
        public Transaction.Currency? Currency { get; set; }
        public DateTime? EffectiveDate { get; set; }
        public decimal? ExpectedInterestAmount { get; set; }
        public decimal? InterestRate { get; set; }
        public decimal? MaturityAmount { get; set; }
        public DateTime? MaturityDate { get; set; }
        public int? Tenor { get; set; }
    }
}

And here is my Database Context class

using Abp.Zero.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Bank.Authorization.Roles;
using Bank.Authorization.Users;
using Bank.MultiTenancy;

namespace Bank.EntityFrameworkCore
{
    public class BankDbContext : AbpZeroDbContext<Tenant, Role, User, BankDbContext>
    {
        /* Define a DbSet for each entity of the application */
        public DbSet<Transactions.Transaction> Transactions { get; set; }

        public BankDbContext(DbContextOptions<BankDbContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.ChangeAbpTablePrefix<Tenant, Role, User>("Tbl_");
        }
    }
}

When I add migration and update my database, I get the error Connection id "0HLF65M4A0D4I", Request id "0HLF65M4A0D4I:0000000E": An unhandled exception was thrown by the application however the Angular project still works fine after runing the refresh.bat file. The error message is not very useful and I’ve done a lot of googling but couldn’t make any headway.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ofuochicommented, Jul 10, 2018

It worked after I commented out the line options.IndexStream = () => Assembly.GetExecutingAssembly().GetManifestResourceStream("Bank.Web.Host.wwwroot.swagger.ui.index.html") I’m assuming that Swagger automatically gets the Ui index.html file from wwwroot

0reactions
MarianoGomezBidondocommented, Oct 16, 2019

I had the same problem, and it was because I changed the name of the XXX.Web.Host project. It was solved by changing where it says GetManifestResourceStream (“XXX.Web.Host.wwwroot.swagger.ui.index.html”) by GetManifestResourceStream (“YYY.Web.Host.wwwroot.swagger.ui.index.html”) where YYY is the new name of the project (YYY.Web.Host)

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - An unhandled exception was thrown by the application ...
The error messages indicates that the ValuesController is being hit. While trying to instantiate this controller the IEcommerceRepository is ...
Read more >
Dashboard Died after failed Authentication setup
[11:25:04 ERR] Connection id "0HMDQVOL7T9O4", Request id "0HMDQVOL7T9O4:00000002": An unhandled exception was thrown by the application.
Read more >
AspNetCore.Server.IIS.Core.IISHttpServer - Connection ID ...
Core.IISHttpServer - Connection ID ..., Request ID ...: An unhandled exception was thrown by the application. System.InvalidOperationException: ...
Read more >
A complete containerized .NET Core Application ...
Connection id "0HLGQ1DIEF1KV", Request id "0HLGQ1DIEF1KV:00000001": An unhandled exception was thrown by the application. System.
Read more >
An error occurred while starting the application.
Connection id "0HLJQPUKMOSEH", Request id "0HLJQPUKMOSEH:00000001": An unhandled exception was thrown by the application. System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found