Base solution for your next web application

Activities of "tteoh"

Hi, I'm using non-core ASP.NET Zero Version 5.6.0 (ASP.NET MVC 5 & AngularJs 1.x) and also published to Azure.

I kept on getting "Your request is invalid!" on DTO custom validation even though I've set the custom validation error message on it. But I can see the custom validation error message on swagger. No matter on local machine or Azure environment and I've set customErrors mode = "RemoteOnly".

Thanks. /Tommy

Hi, I'm using ASPNET CORE & Angular (single solution), .NET Core 2.1, v6.2.0 on MacOSX.

I keep on download this file when I was running the project:

But I can route to http://localhost:5000/swagger/index.html and it's working as expected:

Thanks. /Tommy

Hi ryancyq.

It's my bad that running v5.5.2 but following v6.2.0 tutorial. It's working fine after I downloaded the latest version, which is v6.2.0.

Thanks. /Tommy

Hi ryancyq.

This is the full error stack trace:

Unhandled Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: value
  at System.Boolean.Parse (System.String value) [0x0002a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/boolean.cs:167 
  at COREAJDemo.Web.Startup.AuthConfigurer.Configure (Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration) [0x00015] in /Users/tankianwah/Desktop/COREAJDemo/src/COREAJDemo.Web.Host/Startup/AuthConfigurer.cs:20 
  at COREAJDemo.Web.Startup.Startup.ConfigureServices (Microsoft.Extensions.DependencyInjection.IServiceCollection services) [0x0006e] in /Users/tankianwah/Desktop/COREAJDemo/src/COREAJDemo.Web.Host/Startup/Startup.cs:101 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices (Microsoft.Extensions.DependencyInjection.IServiceCollection services) [0x00028] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices () [0x0000e] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize () [0x0002f] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build () [0x00150] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at COREAJDemo.Web.Startup.Program.Main (System.String[] args) [0x00001] in /Users/tankianwah/Desktop/COREAJDemo/src/COREAJDemo.Web.Host/Startup/Program.cs:10 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null.
Parameter name: value
  at System.Boolean.Parse (System.String value) [0x0002a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/boolean.cs:167 
  at COREAJDemo.Web.Startup.AuthConfigurer.Configure (Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfiguration configuration) [0x00015] in /Users/tankianwah/Desktop/COREAJDemo/src/COREAJDemo.Web.Host/Startup/AuthConfigurer.cs:20 
  at COREAJDemo.Web.Startup.Startup.ConfigureServices (Microsoft.Extensions.DependencyInjection.IServiceCollection services) [0x0006e] in /Users/tankianwah/Desktop/COREAJDemo/src/COREAJDemo.Web.Host/Startup/Startup.cs:101 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices (Microsoft.Extensions.DependencyInjection.IServiceCollection services) [0x00028] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices () [0x0000e] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize () [0x0002f] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build () [0x00150] in <0de102f58bb64e9397f452cd5d2fc76c>:0 
  at COREAJDemo.Web.Startup.Program.Main (System.String[] args) [0x00001] in /Users/tankianwah/Desktop/COREAJDemo/src/COREAJDemo.Web.Host/Startup/Program.cs:10 

Thanks. /Tommy

Hi, I'm using ASPNET CORE & Angular (single solution) v5.5.2.

I followed the instruction from Getting Started (for MacOSX) to run the project.

But I'm getting this exception when I was trying to run the project in Visual Studio for Mac:

I've found out the root caused, which is when trying to get the configuration from appsettings.json:

Thanks. /Tommy

Hi ryancyq,

Thanks for the explanation.

Thanks. /Tommy

Hi ismcagdas,

This problem is solved, sorry that forgot to update here.

Due to the answer here: ORA-08177: can't serialize access for this transaction So I just added Sql("COMMIT") at the last line of the codes at both migrations. (Sorry that didn't mention about I was running 2 migrations)

The answer of why the second migration class is working is because I only ran 1 migration at a time.

For the first migration class that I showed above is getting exceptions is because I ran 2 migrations at a time. Therefore, the first migration class is not committing (I have no idead why is it not committing) then I added Sql("COMMIT") and it's working fine now.


Question Why it is not committing even though I added:

Configuration.UnitOfWork.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;

Thanks. /Tommy

Hi, I'm using non-core ASP.NET Zero Version 5.6.0 (ASP.NET MVC 5 & AngularJs 1.x). I'm connecting to Oracle database. I'm having this exception when operate Update-Database for the migration codes below:

Oracle.ManagedDataAccess.Client.OracleException (0x80004005): ORA-08177: can't serialize access for this transaction ORA-06512: at line 27

public override void Up()
{
    AddColumn("USFA.Visitation", "InitialRecordID", c => c.String(maxLength: 150));

    //AddColumn("USFA.Visitation", "DeviceUserID", c => c.String(nullable: false, maxLength: 256));
    Sql(@"ALTER TABLE ""Visitation"" ADD ""DeviceUserID"" NVARCHAR2(256) DEFAULT 'UserName' NOT NULL");
    Sql(@"UPDATE ""Visitation"" ""v"" SET ""DeviceUserID"" = (SELECT ""UserName"" FROM ""AbpUsers"" ""u"" WHERE ""u"".""Id"" = ""v"".""CreatorUserId"") WHERE ""DeviceUserID"" = 'UserName'");
    Sql(@"ALTER TABLE ""Visitation"" MODIFY(""DeviceUserID"" DEFAULT (null))");
}

public override void Down()
{
    DropColumn("USFA.Visitation", "DeviceUserID");
    DropColumn("USFA.Visitation", "InitialRecordID");
}

But I'm not getting any exception when running the migration codes below:

public override void Up()
{
    //AddColumn("USFA.EntityStatus", "EntityName", c => c.String(nullable: false, maxLength: 50));
    //DropColumn("USFA.EntityStatus", "StatusType");
    Sql(@"ALTER TABLE ""USFA"".""EntityStatus"" RENAME COLUMN ""StatusType"" TO ""EntityName""");
}

public override void Down()
{
    //AddColumn("USFA.EntityStatus", "StatusType", c => c.String(nullable: false, maxLength: 50));
    //DropColumn("USFA.EntityStatus", "EntityName");
    Sql(@"ALTER TABLE ""USFA"".""EntityStatus"" RENAME COLUMN ""EntityName"" TO ""StatusType""");
}

I have already added the codes below to EntityFramework module:

Configuration.UnitOfWork.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;

Should I add this to Web module as well? And I'm using Migrator.exe to run on server, therefore should I add it to Migrator module as well?

Thanks. /Tommy

Hi ismcagdas,

Thank you for the answers.

Thanks. /Tommy

Hi ismcagdas,

There is no problem, please read carefully, I was asking questions :)

Thanks. /Tommy

Showing 11 to 20 of 202 entries