Base solution for your next web application

Activities of "nobruds"

Hello,

I am getting an error while using asp net mvc controller and view with RazorGenerator.

I have an web app that has only a Login view and controller, I use the razor generator to create a dll and use this "Log On" page on all my websites, so I don't need to duplicate code, on this site I need to use abp framework.

This used to work fine, but now I am getting the "service not found" error on this controller

I tried to add the framework and use ApbController base class but didn't work.

What Am I missing here ? :?:

Thanks

Summary: Website 1: common Logon view and controller to use in other sites, like an asp.net ascx control.

Website 2: My main site that references website 1 dll, the page start is the Logon view from Website 1.

After base.Application_Start(sender, e); got the error : "No component for supporting the service Pine.ToolBox.Controllers.AccountController was found"

hello

I am having a problem with the initialization of my modules, its taking too long (10-15 seconds) to load, is it normal ?

here's the Log:

[DEBUG]-[2016-05-18 12:16:15,255] AbpModuleManager - Loading Pine modules... [DEBUG]-[2016-05-18 12:16:20,112] AbpModuleManager - Found 26 Pine modules in total.

The first 5 or more seconds is on this code :

var moduleTypes = AddMissingDependedModules(_moduleFinder.FindAll());

That goes to class WebAssemblyFinder to get all assemblies

List<Assembly> GetAllAssembliesInternal()

Then logs all my modules names

[DEBUG]-[2016-05-18 12:16:20,123] AbpModuleManager - 26 modules loaded.

But then more 7+ seconds until this part:

[DEBUG]-[2016-05-18 12:16:27,257] LocalizationManager - Initializing 2 localization sources.

That is on the PreInitialize, initialize and postInitialize methods for every module

var sortedModules = _modules.GetSortedModuleListByDependency();

sortedModules.ForEach(module => module.Instance.PreInitialize());
sortedModules.ForEach(module => module.Instance.Initialize());
sortedModules.ForEach(module => module.Instance.PostInitialize());

Is 26 too many modules ? or my configuration is wrong in some part ?

Thanks

Hello,

I am getting an error on WindsorControllerFactory, GetControllerInstance method. its trying to resolve my javascripts files as controllers. Why is Castle Windsor trying to resolve 'Scripts' as a controller? is an configuration ?

I saw on stackoverflow that I should use MVCContrib lib for that.

Thanks

Hello,

I think I am doing something wrong about custom repositories.

If I need some logic or filters to be made, I create a custom repository I put that in there, not right ?

I saw on ModuleZeroSampleProject that if you need to perform filters on DB you put that on the ApplicationService

So, What is the best practice here: NHibernate Layer (custom repository)

var result = Session.QueryOver<ConfiguracaoProduto>()
                        .Where(c => c.ProdutoEstruturaID == produtoEstruturaID)
                        .SingleOrDefault();

or

Application layer (service)

private readonly IRepository<ConfiguracaoProduto> _produtoRepository;
var result = _produtoRepository.Single(p => p.ProdutoEstruturaID == produtoEstruturaID);

Hello,

I need to inject a service on static class, how can I do that ?

On my mvc app I am injecting my services on the Controllers as said on docs, but I need to use some statics classes as data providers (I am using DevExpress component for UI), so How can I inject my service in there?

Today I am doing like this: (I don't like it)

Controller

private static IGerenciadorBoletadorService _gerenciadorBoletadorService;
public DashboardController(IGerenciadorBoletadorService gerenciadorBoletadorService)
{
    //static property on PineCalendarioDataProvider.cs
    PineCalendarioDataProvider._gerenciadorBoletadorService = gerenciadorBoletadorService;
}

Thanks

Hello,

I am having problem to use the Abp.Logging.LogHelper class on console apps. On my WebSite log works fine, I do the same process for my windows service app but don't work.

Heres how I initialize my service:

public static void Main(String[] args)
        {
            IocManager.Instance.IocContainer.AddFacility<LoggingFacility>(f => f.UseLog4Net().WithConfig("log4net.config"));

                using (var bootstrapper = new AbpBootstrapper())
                {
                    bootstrapper.Initialize();
                    iocManager = bootstrapper.IocManager;

                    LogHelper.Logger.Info("Start");

                    StartLoop();
                }
        }

I dont get any error, the LogHelper.Logger has all parameters false, so doesn't log.

On Web is like this, and works fine: protected override void Application_Start(object sender, EventArgs e) { IocManager.Instance.IocContainer.AddFacility<LoggingFacility>(f => f.UseLog4Net().WithConfig("log4net.config")); base.Application_Start(sender, e); ... }

Both log4net.config are the same, Am I missing something?

Thanks

Hello

I have a doubt, I think its related more about best practices or concepts.

On your samples I see that on Repository classes you use IQueryable<T>, so you can query over it. I am using "Session.QueryOver<T>()", that uses criteria right ?

Whats the best practice to use with your framework? the performance difference is little ?

Thanks for the help.

Question

Hello,

I was looking into Module zero, to see how can I use auditing logs to insert info on my DB.

But if I follow that example, i wont be able to use the AuditingInterceptor class from Abp framework and AuditedAttribute right ? because wont save on DB

Or there's a way around that, instead I call the "AuditingStore.Save" on Intercept method, I call my db repository ?

Thanks

Hello hikalkan,

What is the proper way to use abp framework with a wcf service and consume it on a asp.net mvc application?

I did an example here but its wrong, I'm getting this error:

Component Abp.Domain.Uow.UnitOfWorkDefaultOptions could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.

I know this happens because of my code, because its registering on every method call. but how should I do it them, where I register my components ?

my code:

GerenciadorBoletadorWCF.svc
public class GerenciadorBoletadorWCF : IGerenciadorBoletadorWCF
    {
        public string GetNumeroBoleto()
        {
            IoContainer IoCDriver = new IoContainer();
            string NumeroBoleto = string.Empty;
            
            dynamic BoletoService = IoCDriver.GetInstance();

            NumeroBoleto = BoletoService.GetBoletoNumero();

            IoCDriver.Release(BoletoService);

            return NumeroBoleto;            
        }
    }

public class IoContainer
    {
        AbpBootstrapper bootstrapper;
        dynamic instance;

        public IoContainer()
        {
            bootstrapper = new AbpBootstrapper();            
            bootstrapper.Initialize();

            instance = bootstrapper.IocManager.Resolve<DependencyDriver>();             
        }

        public void Release(object obj)
        {
            bootstrapper.IocManager.Release(obj);
        }

        public dynamic GetInstance()
        {
            return instance.GetBoletoService();
        }
    }

class DependencyDriver : ITransientDependency
    {
        public readonly IBoletoNumeroService _boletoNumeroService;

        public DependencyDriver(IBoletoNumeroService boletoNumeroService)
        {
            _boletoNumeroService = boletoNumeroService;
        }

        public IBoletoNumeroService GetBoletoService()
        {
            return _boletoNumeroService;
        }
    }

Thanks

Hello,

I'm not sure if this problem is from the abp but How can I execute a procedure with Liked server?

I'm getting the following error:

Unable to start a nested transaction for OLE DB provider "SQLNCLI10" for linked server "PINE_SQL". A nested transaction was required because the XACT_ABORT option was set to OFF. OLE DB provider "SQLNCLI10" for linked server "PINE_SQL" returned message "Cannot start more transactions on this session.".

My code on the Repository:

Session.CreateSQLQuery(
                    "EXEC BoletadorAtivos.dbo.blt_IntegracaoFuncaoCapitalGiroRegistro_sp @Operacao_ID = N'" + Operacao_ID + "'")
                    .ExecuteUpdate();

I just use the CreateSQLQuery from nhibernate.

My procedure tries to do an INSERT on another BD using Linked Server but fails, only SELECTS works with Linked Server.

Anybody has a clue why?

Thanks

Showing 1 to 10 of 11 entries