Base solution for your next web application

Activities of "gvb"

Answer

I found that the error come from Error.cshtml

But i don't really know how this view is working really... it never appeared on any page!

so how does it work, how do i make it appear!

thx

Question

hey,

I'm trying to integrate Elmah, Elmah MVC, Elmah Contrib WebApi.

My probleme is coming from MVC part, it register my error and it register an other from ABP but the WebApi part work perfectly.

Does someone know how to fix this ? Here is the error :

The model item passed into the dictionary is of type 'System.Web.Mvc.HandleErrorInfo', but this dictionary requires a model item of type 'Abp.Web.Mvc.Models.ErrorViewModel'.

The stack trace :

System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Web.Mvc.HandleErrorInfo', but this dictionary requires a model item of type 'Abp.Web.Mvc.Models.ErrorViewModel'.
   at System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value)
   at System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary dictionary)
   at System.Web.Mvc.WebViewPage`1.SetViewData(ViewDataDictionary viewData)
   at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance)
   at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer)
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

thx in advance :)

EDIT: Just to tell, my error is handled correctly by Elmah MVC but i feel that i shouldn't receive an other error in the same time ;) that tell me that i require an Abp.Web.Mvc.Models.ErrorViewModel or tell me if i can switch this somewhere in the application! :)

Answer

I deploy from Visual Studio without problem. We do our DB migration and update via Visual Studio for our Azure DB.

OHH UI Bootstrap got his new nuget package to fix the problems!!

thx i didnt check back if they had released the nuget ...

i got the same problem with AngularJS 1.4

They changed the way the animation work in 1.4 and it broke UI Bootstrap. so i rollbacked AngularJS to 1.3 !

So if you check your HTML parsed you will see that modal-open class is still in the body tag... I tried to hack it and remove it by myself and it still didnt work... so that's why i rollbacked AngularJS

Answer

I'm deploying to Azure for my webApp and it's pretty straight forward and still no problem with the publish !

i didn't know about the ISmtpEmailSender injection! It will save some lines of code in a lot of place :) thx

for the Seed i just posted where i add those to the DB because i always do the verification if it exist or not!

Like this

if (!_context.Settings.Any(x => x.Name == EmailSettingNames.Smtp.Host) 
{
    _context.Settings.Add(new Abp.Configuration.Setting
    {
        Name = EmailSettingNames.Smtp.Host,
        Value = "smtp.gmail.com"
    });
}

i don't know if it can be better !

I must agree on somepart I'm a begginner afterall i will get my first year as a Programmer soon (missing 1 month) A real app showing some underground part could be helpfull amd could make more user looking toward ABP.

It has been hard to understand at the beggining and still it's pretty hard on some point, but he's doing a great job from where i started ABP until today ;) ( sometime i'm hard against it .... but this guys is doing so much work on top of his job...)

When i started ABP there was no Forum, it was harder to understand thing but now with the forum you ask question to other to know how to do what you need. Sometime it's not related to ABP directly but a simple question can make a clear path where to search!

And we are always asking for more... he can't do everything for everyone!

its my 2cents :) I wish you the best of luck to learn ABP, its a pretty good ASP.Net Framework!

I will give how i did it! It's not the best way of doing it but it use some built-in part of ABP

First i added some Setting in the database with Seed (preferably do it manually in production with a script) my site is still in progress so i keep it there to rebuild it anywhere pretty fast.

// Seed
                _context.Settings.Add(new Abp.Configuration.Setting
                {
                    Name = EmailSettingNames.Smtp.Host,
                    Value = "smtp.gmail.com"
                });

                _context.Settings.Add(new Abp.Configuration.Setting
                {
                    Name = EmailSettingNames.Smtp.Port,
                    Value = "587"
                });

                _context.Settings.Add(new Abp.Configuration.Setting
                {
                    Name = EmailSettingNames.Smtp.UserName,
                    Value = "YOUR EMAIL"
                });

                _context.Settings.Add(new Abp.Configuration.Setting
                {
                    Name = EmailSettingNames.Smtp.Password,
                    Value = "YOUR PASSWORD"
                });

                _context.Settings.Add(new Abp.Configuration.Setting
                {
                    Name = EmailSettingNames.Smtp.EnableSsl,
                    Value = "true"
                });

                _context.Settings.Add(new Abp.Configuration.Setting
                {
                    Name = EmailSettingNames.Smtp.UseDefaultCredentials,
                    Value = "false"
                });

then i use that code in ApplicationService :

private readonly ISmtpEmailSenderConfiguration _smtpConfig;

        public SendGeneratedCode(ISmtpEmailSenderConfiguration smtpConfig)
        {
            _smtpConfig = smtpConfig;
        }

        public void Execute(GenerateCodeMessage msg)
        {
            var smtpClient = new SmtpEmailSender(_smtpConfig).BuildClient();

            var from = new MailAddress(_smtpConfig.UserName);

            smtpClient.Send(new MailMessage(from, new MailAddress("EMAIL TO"))
            {
                Subject = "SUBJECT",
                Body = "CONTENT",
                IsBodyHtml = true
            });
        }

i hope it will help you a little bit :)

I got some probleme with my Google account that it say someone unsafe tried to use my account, but i activated an option to tell that it can be used by unsafe application, but i doesnt remember exactly what was the name of the paramater. And the email sent is usually in the Garbage of my outlook until i tell outlook that it is a safe email source....

Ok thx

i was asking before implementing the IUserTokenProvider or if i want to do a custom reset token

Showing 11 to 20 of 53 entries