Base solution for your next web application

Activities of "byteplatz"

After changing the AppFeatureProvider from main app and build/run with F5 the feature from my custom module showed up.

Weird behavior that I am getting sometimes with other things as well: Sometimes when I reload while debugging (F5) my custom module dlls are not loaded or code inside it is not added to main app...

Maybe this is a problem with assembly scanning ?

Bruno

Hello there,

We have a separated module from main app and we are trying to create a feature to enable/disable this module.

I am coding this inside the separated solution (my custom module) :

I have created a feature provider and set features like this:

context.Create(
                MyCustomModule.MyFirstFeature,
                defaultValue: "false",
                displayName: L("MyCustomModule"),
                scope: FeatureScopes.All,
                inputType: new CheckboxInputType()
            );

And added this line to MyCustomModuleCoreModule.cs:

Configuration.Features.Providers.Add<MyCustomModuleFeatureProvider>();

I can check in main app logs that this code is being called (I have couple debug logs), but the feature is not showing in tenant or edition selections.

Do I need to do anything else to make the features show up in the menus for tenant and edition selection ?

Cheers

Bruno

Thanks Halil,

I will implemente like that !

Regards

Bruno

The first idea that came up was create a shared interface for example ICreatePermissionsForDefaultTenant and use main app DefaultTenantRoleAndUserCreator seed to execute the code from several modules.

The same apply for menus created by the separated module...And I thinkg other things will benefit for the given approach as well. Thus, main app does not know about the service module but still can add permissions, menus and such into the database.

Bruno

Hello,

We are using aspnetzero to develop a distributed system based on SOA, DDD and CQRS principles together with NServiceBus ([http://www.particular.net])).

We are using the approach of separated module for each SOA Service.

We have a main app (aspnet zero code with few customizations). We have a service module (based on [https://github.com/aspnetboilerplate/sample-blog-module])).

Each service is meant to be autonomous and the separated sample blog module seems to be a perfect fit for that.

Next step for us is to come up with a solid approach for configuring permissions. We already have a separated module adding permissions (and they are appearing fine in main app).

We are using the default tenant as the 'Test' tenant for internal use and test of features before they are released to customers.

The question here is : What is the best approach to add service module permissions (from separated solution) to default tenant roles ?

I mean, we dont have the Context from main app inside the sercie module (and we dont find it right indeed).

Ideas/Recommendations ?

Cheers

Bruno Bertechini

Great. I was going pretty much the same thought.

I will try something like that in near future.

Bruno Bertechini

Thank you very much. It worked like a charm.

I did the following:

  • Main App upgraded to 1.6 (clean install - localization db working)
  • Custom Module in separate solution containing default projects (core, app, web, entityframework)
  • Custom Module Web Core Project CoreModule with:
public override void PreInitialize()
        {
            //Add/remove localization sources
            Configuration.Localization.Sources.Add(
                new DictionaryBasedLocalizationSource(
                    MyModuleConsts.LocalizationSourceName,
                    new XmlEmbeddedFileLocalizationDictionaryProvider(
                        Assembly.GetExecutingAssembly(),
                        MyModuleConsts.LocalizationSourceRootNameSpace
                        )
                    )
                );
        }

And the localization is working out of the box...

For another module (separated solution as well, I didnt have to change anything)

Well done !!!

Amazing job on these smooth upgrades!

Regards

Bruno Bertechini

Thank you very much

I will code accordingly and get back to you

Bruno

Ok thanks.

Do I need to add this code to PreInitialize for each custom module ? Or only in App (since I am using a separated solution for each module)

//Use database as language management
            Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization();

Cheers

Bruno

I can see that WebModule has a new config line :

Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization();

Bottomline I just need that line at my custom module core Project module and remove this

//Add/remove localization sources
            Configuration.Localization.Sources.Add(
                new DictionaryBasedLocalizationSource(
                    CardStockConsts.LocalizationSourceName,
                    new XmlEmbeddedFileLocalizationDictionaryProvider(
                        Assembly.GetExecutingAssembly(),
                        CardStockConsts.LocalizationSourceRootNameSpace
                        )
                    )
                );

Is that enough or do I need to do something else ?

Bruno

Showing 41 to 50 of 57 entries