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

Build error on upgrading to core 2.0 #4319


User avatar
0
manojreddy created

I have taken the latest code based on 2.0 and tried to merge it with old code.

I'm getting too many errors on build solution, please help.

Severity Code Description Project File Line Suppression State Error CS0117 'AppSettings' does not contain a definition for 'HostManagement' Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 169 Active Error CS0117 'AppSettings' does not contain a definition for 'HostManagement' Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 170 Active Error CS1061 'IModuleConfigurations' does not contain a definition for 'AspNetZero' and no extension method 'AspNetZero' accepting a first argument of type 'IModuleConfigurations' could be found (are you missing a using directive or an assembly reference?) Test.ABCD.Web.Public C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Public\Startup\ABCDWebFrontEndModule.cs 28 Active Error CS0006 Metadata file 'C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\bin\Debug\netcoreapp1.1\Test.ABCD.Application.dll' could not be found Test.ABCD.Web.Public C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Public\CSC 1 Active Error CS0006 Metadata file 'C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Business.Data\bin\Debug\netcoreapp1.1\Test.ABCD.Business.Repositories.dll' could not be found Test.ABCD.Web.Public C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Public\CSC 1 Active Error CS0006 Metadata file 'C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Business.Dto\bin\Debug\netcoreapp1.1\Test.ABCD.Business.Dto.dll' could not be found Test.ABCD.Web.Public C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Public\CSC 1 Active Error CS0006 Metadata file 'C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Business.Services\bin\Debug\netcoreapp1.1\Test.ABCD.Business.Services.dll' could not be found Test.ABCD.Web.Public C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Public\CSC 1 Active Error CS0006 Metadata file 'C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Core\bin\Debug\netcoreapp1.1\Test.ABCD.Web.Core.dll' could not be found Test.ABCD.Web.Public C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Public\CSC 1 Active Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Test.ABCD.Application.csproj 1 Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.ConsoleApiClient C:\Users\myname\source\repos\ABCD\aspnet-core\test\Test.ABCD.ConsoleApiClient\Test.ABCD.ConsoleApiClient.csproj 1 Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.Business.Dto C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Business.Dto\Test.ABCD.Business.Dto.csproj 1 Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.Business.Repositories C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Business.Data\Test.ABCD.Business.Repositories.csproj 1 Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.Business.Services C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Business.Services\Test.ABCD.Business.Services.csproj 1 Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.Web.Core C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Core\Test.ABCD.Web.Core.csproj 1 Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.Tests C:\Users\myname\source\repos\ABCD\aspnet-core\test\Test.ABCD.Tests\Test.ABCD.Tests.csproj 1 Error NU1201 Project Test.ABCD.Application.Shared is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Project Test.ABCD.Application.Shared supports: netstandard2.0 (.NETStandard,Version=v2.0) Test.ABCD.Web.Host C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Host\Test.ABCD.Web.Host.csproj 1 Error CS0103 The name 'DatabaseCheckHelper' does not exist in the current context Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 112 Active Error CS0103 The name 'DefaultLanguagesCreator' does not exist in the current context Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 86 Active Error CS0103 The name 'SeedHelper' does not exist in the current context Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 56 Active Error CS0234 The type or namespace name 'AspNetZeroCore' does not exist in the namespace 'Abp' (are you missing an assembly reference?) Test.ABCD.Web.Public C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Web.Public\Startup\ABCDWebFrontEndModule.cs 1 Active Error CS0234 The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Test.ABCD' (are you missing an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 20 Active Error CS0234 The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Test.ABCD' (are you missing an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 20 Active Error CS0246 The type or namespace name 'HostBillingSettingsEditDto' could not be found (are you missing a using directive or an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 167 Active Error CS0234 The type or namespace name 'Migrations' does not exist in the namespace 'Test.ABCD' (are you missing an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 23 Active Error CS0234 The type or namespace name 'Migrations' does not exist in the namespace 'Test.ABCD' (are you missing an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 23 Active Error CS0234 The type or namespace name 'Migrations' does not exist in the namespace 'Test.ABCD' (are you missing an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 24 Active Error CS0234 The type or namespace name 'Migrations' does not exist in the namespace 'Test.ABCD' (are you missing an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 24 Active Error CS0246 The type or namespace name 'ABCDDbContext' could not be found (are you missing a using directive or an assembly reference?) Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 34 Active Error CS0305 Using the generic type 'AbpZeroDbMigrator<TDbContext>' requires 1 type arguments Test.ABCD.Application C:\Users\myname\source\repos\ABCD\aspnet-core\src\Test.ABCD.Application\Install\InstallAppService.cs 38 Active


71 Answer(s)
  • User Avatar
    0
    manojreddy created

    @aaron

    Please help buddy

  • User Avatar
    0
    aaron created
    Support Team
  • User Avatar
    0
    manojreddy created

    @aaron

    ABP version : 3.2.5

    I have checked, I have v5.0.4 version.

    Thanks

  • User Avatar
    0
    manojreddy created

    @aaron any updates?

  • User Avatar
    0
    manojreddy created

    Solved issue buddy.

    Thanks

  • User Avatar
    0
    manojreddy created

    But APIs are getting random required fields which I have not even mentioned in DTO. due to this most of the APIs call are getting failed.

    Thanks

  • User Avatar
    0
    aaron created
    Support Team
    1. Please post how you resolved the previous issue as an answer to your Stack Overflow question.
    2. Can you show the code for your entity and DTO?
  • User Avatar
    0
    manojreddy created

    DTO:

    using Abp.Runtime.Validation;
    using MyCompany.MyProject.Dto;
    
    namespace MyCompany.MyProject.Business.Dto.Tests
    {
        public class FetchTestInput: PagedAndSortedInputDto, IShouldNormalize
        {
            public int TestLevel { get; set; }
            public int CodeType { get; set; }
            public string TestCode { get; set; }
            public string DescLong { get; set; }
            public string LanguageCode { get; set; }
            public string TestParent { get; set; }
    
            public int? TestCondID { get; set; }
            public int? TestResultId { get; set; }
    
            public void Normalize()
            {
                if (string.IsNullOrEmpty(Sorting))
                {
                    Sorting = "TestCode";
                }
            }
    
        }
    }
    

    API method:

    public PagedResultDto<FetchTest> GetSearchTest(FetchTestInput searchInput)
            {
                return _TestRepository.GetSearchTest(searchInput);
            }
    

    Entity:

    using Abp.Domain.Entities.Auditing;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;
    
    namespace MyCompany.MyProject.Business.Model.Tests
    {
        [Table("Test")]
        public class Test : FullAuditedEntity
        {
            public const int NVarcharLength3 = 3;
            public const int NVarcharLength40 = 40;
            public const int NVarcharLength250 = 250;
    
            [Required]
            [MaxLength(NVarcharLength250)]
            public string TestCode { get; set; }
    
            [Required]
            public int TestLevel { get; set; } = 0;
    
            [MaxLength(NVarcharLength250)]
            public string TestParent { get; set; }
    
            [Required]
            public int CodeType { get; set; } = 0;
    
            [MaxLength(NVarcharLength3)]
            public string CurrencyCode { get; set; }
    
            [Required]
            [MaxLength(NVarcharLength40)]
            public string DescLong { get; set; }
    
            [Required]
            [MaxLength(NVarcharLength40)]
            public string DescShort { get; set; }
    
            [Required]
            public bool FlgAllow1 { get; set; } = true;
    
            [Required]
            public bool FlgAllow2 { get; set; } = false;
    
            [Required]
            public bool FlgAllow3 { get; set; } = false;
    
            [Required]
            public bool FlgAllow4 { get; set; } = true;
    
            [Required]
            public bool FlgAllow5 { get; set; } = true;
    
            [Required]
            public bool FlgFood6 { get; set; } = true;
    
            [Required]
            public bool Flg7 { get; set; } = true;
    
            [Required]
            public bool Flg8 { get; set; } = false;
    
            [Required]
            public decimal MaxPrice { get; set; } = 0;
    
            [Required]
            public int TestMemberId { get; set; } = 0;
    
            [Required]
            public decimal MinPrice { get; set; } = 0;
    
            public int? TestDiscountId { get; set; }
    
            public int? TestDataCode { get; set; }
        }
    }
    

    Please find the attached screenshot for your reference.

  • User Avatar
    0
    aaron created
    Support Team

    Can you find where ClassificationLevel and CodeType appears in your project?

  • User Avatar
    0
    manojreddy created

    ClassificationLevel and CodeType are TestLevel ans TestCode. I just replaced Classification by Test to show you code.

  • User Avatar
    0
    aaron created
    Support Team

    Try setting a default value explicitly:

    public class FetchTestInput: PagedAndSortedInputDto, IShouldNormalize
    {
        public int TestLevel { get; set; } = 0;
        public int CodeType { get; set; } = 0;
        // ...
    }
    
  • User Avatar
    0
    manojreddy created

    I have to explicitly pass the value for TestLevel and CodeType as 0 from UI now. But this functionality was working fine before the upgrade to core 2.0 (I was not passing default value for any parameter). So I have to make this change in all UI pages according to APIs. But I think this is not the way. Can I do something without making so many changes in throughout my application?

    Why have these fields become Required now? Even in Swagger UI, it was not required before for fields.

    Can I disable this feature?

  • User Avatar
    0
    aaron created
    Support Team

    Did you try what I suggested?

  • User Avatar
    0
    manojreddy created

    Yes, I tried but it’s not working. I have to explicitly set TestLevel and CodeType to 0 also from UI.

  • User Avatar
    0
    manojreddy created

    UI has also become distorted for my existing components which I had developed on previous framework.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ManojReddy,

    This change might be done by ASP.NET. When you upgrade ABP, you also upgrade ASP.NET versions.

    Also, your UI changes might be related to client side libraries.

    By the way, which template you are using ? (ASP.NET Core & jQuery or ASP.NET Core & Angular).

  • User Avatar
    0
    manojreddy created

    Thanks for your reply.

    I'm using ASP.NET Core & Angular.

  • User Avatar
    0
    ismcagdas created
    Support Team

    So, were you using AngularJs and trytign to move to Angular ? If so, your previous components will not work, you need to align them with angular 5.

    For your other problem, can you show us a use case ? You can share your app service input class and content of your ajax request will be great.

  • User Avatar
    0
    manojreddy created

    <cite>ManojReddy: </cite> I have to explicitly pass the value for TestLevel and CodeType as 0 from UI now. But this functionality was working fine before the upgrade to core 2.0 (I was not passing default value for any parameter). So I have to make this change in all UI pages according to APIs. But I think this is not the way. Can I do something without making so many changes in throughout my application?

    Why have these fields become Required now? Even in Swagger UI, it was not required before for fields.

    Can I disable this feature?

    Could you please reply on this.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @ManojReddy,

    If I understand correctly, you are upgrading from ASP.NET MVC 5.x to ASP.NET Core, so this is the expected behaviour.

  • User Avatar
    0
    manojreddy created

    Thanks a lot dear :)