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

Activities of "jcompagnon"

Thanks, that worked!

Hello,

Using ABP.Hangfire 2.1.3, I'm trying to create a recurring job to send a daily email. Following many of the suggestions from #2645, I have the following:

public override void PreInitialize()
        {
Configuration.BackgroundJobs.UseHangfire(configuration => configuration.GlobalConfiguration.UseSqlServerStorage("Default"));
            GlobalConfiguration.Configuration.UseActivator(new WindsorHangFireJobActivator());
}
public override void PostInitialize()
        {
            IDailyEmailTaskAppService dailyEmailTaskAppService = IocManager.Resolve<IDailyEmailTaskAppService>();
            RecurringJob.AddOrUpdate(() => dailyEmailTaskAppService.SendDailyEmail(), Cron.Daily);}
class DailyEmailTaskAppService : FirstASPNetZeroAppServiceBase, IDailyEmailTaskAppService
    {
        private readonly IEmailSender _emailSender;
        private readonly IOrganizationUnitAppService _organizationAppService;

        public DailyEmailTaskAppService(IEmailSender emailSender, IOrganizationUnitAppService organizationAppService)
        {
            _emailSender = emailSender;
            _organizationAppService = organizationAppService;
        }
        
[UnitOfWork]
        public virtual void SendDailyEmail()
        {
            using(CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant))
            {
                _emailSender.SendAsync("[email protected]", "Test Email Subject", "Test Email Body", false);
            }
        }
    }

Unfortunately, I'm still getting the same error as the last from the linked post, namely

Could not load file or assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

.

Note that I'm very new to boilerplate so not everything done may be best way of doing things.

Thanks in advance!

Hello,

Thank you for the response; I've just sent along an email.

Hello,

Thank you for looking into this.

Currently in my solution, FirstASPNetZero is the starter solution - the ASPNET Zero template. In it, I'm using the "Mpa" area to test out some of the features of ABP & ASPNet Zero, while in the solution, I've also added other projects while trying to learn about the module system. To that end, I have in the solution a folder for "Announcements", which contains the various layers of that module (Announcements.Web, Announcements.Application, etc). I then made my main module, FirstASPNetZeroWebModule, depend on the AnnouncementsWebModule.

Here's a screenshot of my current solution: [attachment=0:1vfbwr5d]AnnouncementsModuleScreenCap.PNG[/attachment:1vfbwr5d]

I'm sure this is something trivial that I'm just not understanding, but I've been wracking my head trying to figure it out and not making much progress. Any help would be appreciated!

Thanks again,

Hello,

Are there any updates on this?

Hello,

No worries for the late response - I've been working on learning other aspects of ABP's module system.

I've not yet been able to resolve this - I'd appreciate any help you can offer!

Thanks!

As a quick addendum, this is the error logged through log4net:

System.Web.HttpException (0x80004005): The file '/FirstAspNetZero/Views/Announcements/Index.cshtml' does not exist.
   at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)...

"FirstAspNetZero.Web" is the name of my test application, with the file located at "Announcements.Web/Views/Announcements", in a test module with the following Embedded resources configured in the module class:

[DependsOn(typeof(AnnouncementsApplicationModule), typeof(AbpWebApiModule), typeof(AbpWebMvcModule))]
    public class AnnouncementsWebModule : AbpModule
    {
        public override void PreInitialize()
        {
            Configuration.EmbeddedResources.Sources.Add(
                new EmbeddedResourceSet(
                    "/Views/",
                    Assembly.GetExecutingAssembly(),
                    "Announcements.Web.Views"
                    )
                );
        }

Hello,

I've recently begun trying out the module system to allow for independent features to be developed separately, but I'm having a problem when it comes to including .cshtml files in custom modules.

In particular, while I'm able to hit my module's controller, the site is unable to find the appropriate Index.cshtml file. I tried embedding the .cshtml files as described in <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Embedded-Resource-Files">https://aspnetboilerplate.com/Pages/Doc ... urce-Files</a> , but when I navigate to the module's page I get a Page 404 as the result.

The steps I took to register the views were: 1 - Mark all files in my module's /Views/ folder to be embedded resources 2 - Added an Embedded Resource set in my module's PreInitialize method

Again, this custom module's controller receives the request as expected. Is there something else I need to do to reach embedded view files of different modules?

Ah, that's great!

Thank you both for looking into this, and again for the awesome framework. I'll definitely be upgrading to 2.x in the near future; thanks for the heads up!

Hello, and thanks for the response!

I combed through my project for the "abp.utils.setCookieValue" function, and saw that it gets called a few times to set the Tenant and Authorization cookies; I don't see it being called for changing the Culture, however. It looks like, instead, the cookie is only being set in the AbpLocalization controller when a call is made to "AbpLocalization/ChangeCulture" in the "_Header.cshtml" file, so what I've done is re-created a controller based on AbpLocalizationController whose "ChangeCulture" method specifies a Path as the request's ApplicationPath, in the same way the CurrentCultureSetter class does. This allows me to change cultures as desired, but I know it's pretty hacky, since it's basically just redefining a framework class for the sake of changing this Path setting. Do you have any suggestions on how else I might achieve this? Thanks again for the help!

Showing 21 to 30 of 39 entries