Base solution for your next web application

Activities of "hugol"

Hi,

Just a quick question following up a post that I did regarding the "Update Person" example in another thread. Following your recommendations I was able to implement the Update but I have a doubt after reading the recommended documentation: [https://aspnetboilerplate.com/Pages/Documents/Domain-Services]) [https://aspnetboilerplate.com/Pages/Documents/Repositories])

You have the following text on the Domain Services: Why Not Only Application Services? You can say that why application service does not implement the logic in the domain service? We can simply say that it's not application service task. Because it's not a use-case, instead, it's a business operation. We may use same 'assign a task to a user' domain logic in a different use-case. Say that we may have another screen to somehow update the task and this updating can include assigning the task to another person.So, we can use same domain logic there. Also, we may have 2 different UI (one mobile application and one web application) that shares same domain or we may have a web API for remote clients that includes a task assign operation.

Shouldn't we use always Domain Services and Managers instead of using repositories directly in the Application Services? Because even for simple CRUD operations, they will be most likely repeated for each, for example, different UIs.

Kind regards, Hugo

Question

Hello,

I couldn't find a thread related to this so I would like to ask what would be the best/correct way to only Seed some data when the Tenant is being created.

The scenario is something like this:

  • The Host admin will create a new tenant for Client Z
  • When creating a new Tenant you would like to pre-populate some data (let's say Countries, Currencies, Post Codes, etc.)

In the method:

protected override void Seed(EntityFramework.WebPropterDbContext context)

located in the Configuration.cs method we can add code on the following path:

else
            {
                //You can add seed for tenant databases using Tenant property...
            }

So repeating the initial question, what would be the best/correct way to only seed some data when the Tenant is being created in Production and to seed all the data in the development environment.

Something like:

// Run all default data
SeedTenantSetupData();
if (isDevelopmentEnvironment){
  SeedDevelopmentData();
}

In the following guide: [https://aspnetzero.com/Documents/Developing-Step-By-Step-MPA#adding-a-new-page])

It's suggested to use the "Update-Database" method. For people using Multi Tenancy, multi databases (1 database per tenant), shouldn't we use the Migrator instead to apply the changes to all the tenant databases?

Thanks HugoL

Question

Hi,

I've created everything in my local environment without a problem and now I'm trying to replicate this scenario in a live environment using Winhost (despite the fact that this is just a test).

So the steps that I did till now are:

  1. Created the Databases and the users using the Winhost Cpanel
  2. Created the directory for the new Web app and the proper DNS
  3. Used the Migrator tool to create the Host DB
  4. Published the Web Project (My webconfig.release has the proper configurations)

Now so far so good, everything is working properly. I can log in to the host and update the settings (emails are being sent) etc.

The problem is I can't create a tenant. For example if I try to create a tenant with the following parameters I get an error:

Tenancy Name: SomeExample Tenant: SomeExample Ltd Use Host Database: No

Data Source=?? Now this is the first question/problem, WinHost connections strings are like this: "Data Source=tcp:[servernumber].winhost.com;Initial Catalog=DB_[customeraccountnumber][databasename];User ID=DB[customeraccountnumber]_[databasename]_user;Password=password;Integrated Security=False;"

1st Question:<ins>What should I type in the Data Source box?</ins>

2nd Question:<ins>When creating a tenant does ABP tries to create the tenant database and apply the migrations or do we need to run the Migrator for the tenants?</ins>

Thanks in advance for further help, HugoL

tcp:s12.winhost.com;Initial Catalog=DB_wpropterhlmt;User ID=DB_80397_user;Password=*****;Integrated Security=False;

Hi,

Quick suggestion: Shouldn't the field [Abp.Net.Mail.Smtp.Password] at AbpSettings table be Hashed?

Should I post this kind of suggestion here or on Github?

Thanks HugoL

Hello,

When using the feature to send the "Test" Email in the Host (i.e. <a class="postlink" href="http://localhost:6240/Mpa/HostSettings">http://localhost:6240/Mpa/HostSettings</a>), I've noticed that the email is sent but the "Display Name" and "Send from email" are being ignored.

This code is stored at HostSettingsAppService.cs and the method is:

    public async Task SendTestEmail(SendTestEmailInput input)
    {
        await _emailSender.SendAsync(
            input.EmailAddress,
            L("TestEmail_Subject"),
            L("TestEmail_Body")
        );
    }

The variable "_emailSender" is defined in the ABP dlls (IEmailSender).

When the email arrives at my inbox the Display name and the "from" email is being ignored.

I don't know if the problem is related to the ABP framework or the fact that I'm using Outlook.com Alias. I think the latter is the problem but I'm not sure.

Anyone around that have experienced a similar situation or know how to sort this situation?

Any help would be most welcomed. Thanks.

Hi there,

When I run or deploy/publish my website to my local servers everything works fine but when I publish the site to my Winhost account I get the following problem: Server Error in '/Test_PlaygroundPrj' Application. Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

In order to sort this I have to add the following entry to the web.config

<system.web>
    <trust level="Full"/>

Note: Any level below (High, Medium...) will throw the same error.

From MSDN: "FULL" Specifies unrestricted permissions. Grants the ASP.NET application permissions to access any resource that is subject to operating system security. All privileged operations are supported. [https://msdn.microsoft.com/en-us/library/tkscy493%28v=vs.85%29.aspx])

Any ideas? comments? feedback? Is this the correct approach to sort the problem. I can give you access to the server if you would like since this is just a playground account and project for testing purposes.

========== Full LOG ========== Server Error in '/Test_PlaygroundPrj' Application.

Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

Source Error: [No relevant source lines]

Source File: f:\tempdir\v4.0.30319\test_playgroundprj\a65af6ea\76786a49\App_global.asax.k0nvxyo6.0.cs Line: 0

Stack Trace: [TypeLoadException: Inheritance security rules violated while overriding member: 'Castle.MicroKernel.DefaultKernel.InitializeLifetimeService()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.] Castle.Windsor.WindsorContainer..ctor() +0 Abp.Dependency.IocManager..ctor() +44 Abp.Dependency.IocManager..cctor() +30

[TypeInitializationException: The type initializer for 'Abp.Dependency.IocManager' threw an exception.] Mood2Success.Test_PlaygroundPrj.Web.MvcApplication..ctor() +53 ASP.global_asax..ctor() in f:\tempdir\v4.0.30319\test_playgroundprj\a65af6ea\76786a49\App_global.asax.k0nvxyo6.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +206 System.Activator.CreateInstance(Type type, Boolean nonPublic) +83 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1065 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +124 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +20 System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +263 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946024 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Hi there,

I've realised that since June the aspnet-zero project had so many changes that would be easier to recreate the "playground" project from scratch. After downloading a new project again I've had the following issues:

Project compiled but doesn't run with the error: "Could not load file or assembly 'System.Web.Mvc, Version=5.1.0.0..."

To fix this I had to comment the following entry in the web.config


and add

<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />

After solving this problem I get the following error message in a window: Unhandled exception at line 716, column 5 in <a class="postlink" href="http://localhost:6240/AbpScripts/GetScripts">http://localhost:6240/AbpScripts/GetScripts</a> 0x800a138f - JavaScript runtime error: Unable to get property 'antiForgery' of undefined or null reference

I can "break" or press "continue" the code execution but if I press "continue" I'm unable to login and I get the following error: "An Error has occurred! Error detail not sent by the server."

Any suggestion?

Thank you

Hello,

After upgrading to the latest version, I'm unable to compile the Mood2Success.Test_PlaygroundPrj.Web project. I'm getting the error:
Error CS0246 The type or namespace name 'MvcAjaxResponse' could not be found[/quote] (are you missing a using directive or an assembly reference?) Mood2Success.Test_PlaygroundPrj.Web C:_Projects\Test_PlaygroundPrj\Mood2Success.Test_PlaygroundPrj.Web\Controllers\ProfileController.cs 163 Active

I've noticed that at this location (Module Zero Template) the controllers no longer exist and additionally I realised that the AccountController was changed and some other are news: [https://github.com/aspnetboilerplate/module-zero-template/tree/master/src/AbpCompanyName.AbpProjectName.WebMpa/Controllers])

What's the best way to upgrade a project? I followed the instructions at [https://aspnetzero.com/Faq#FaqAccordionPanels_5]), I also checked the github and the forums searching for anything related with "ProfileController" but and I can't find anything.

Any suggestion? Thank you

Question

Hi there,

I've update my project to the lastest version using the following commands:

get-project -all | get-package | ?{ $_.Id -like 'Abp*' } | update-package
Install-Package Abp.Zero
Install-Package Abp.Zero.Ldap
Install-Package Abp.Zero.EntityFramework
Install-Package Abp.Zero.NHibernate

and I'm now getting the following error: Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'IValidate' could not be found (are you missing a using directive or an assembly reference?) Mood2Success.Test_PlaygroundPrj.Application C:_Projects\Test_PlaygroundPrj\Mood2Success.Test_PlaygroundPrj.Application\Configuration\Host\Dto\EmailSettingsEditDto.cs 5 Active

The project reference is: Assembly Abp C:_Projects\Test_PlaygroundPrj\packages\Abp.0.12.0.0\lib\net452\Abp.dll Assembly Abp.Zero C:_Projects\Test_PlaygroundPrj\packages\Abp.Zero.0.12.0.0\lib\net452\Abp.Zero.dll

Do you know what do I need to do to sort this problem?

Kind regards, Hugo

Showing 1 to 10 of 11 entries