Base solution for your next web application

Activities of "alexzapros"

Question

Hi,

I saw news here <a class="postlink" href="https://volosoft.com/whats-new-in-asp-net-boilerplate-2-1-and-asp-net-zero-4-1/">https://volosoft.com/whats-new-in-asp-n ... -zero-4-1/</a>

But I don' see ability to download it from personal cabinet. When it will be available?

Hi,

Thanks!

Hi, Could you please share your experience of how you debug, run solution with 2 web projects, Before this I've hosted web project under IIS and can attach this process from VS. It's comfortable reattach without server restarting and use re-attach extension.

For now with ASP.CORE doesn't save proper values to bind site to IIS, see this: <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>

This variable are set only when publish. But I am wanted to debug my site like following: <a class="postlink" href="http://localhost/zerosite-admin">http://localhost/zerosite-admin</a> <a class="postlink" href="http://localhost/zerosite-api">http://localhost/zerosite-api</a>

Is it possible?

Any best practices of how you develop are welcome!

Sorry, cant send project to you.

I can send you cookies, request, and log if fine?

Hi,

Do you wait for a while after opening page ? If so, how much do you wait ? Now I don't wait. Just put this URL into browser.

Do you also run another AspNet Zero project at the same time ? No - this is new tab of Chrome browser.

Hi I have open page at my browser, specially not close it. And it occurs every time I refresh it.

When I open new browser with new window - error not happen.

Question

Hi I've got error on page resfresh There is no current user!

What it can be?

Details are following:

Описание: Необработанное исключение при выполнении текущего веб-запроса. Изучите трассировку стека для получения дополнительных сведений о данной ошибке и о вызвавшем ее фрагменте кода.

Сведения об исключении: System.ApplicationException: There is no current user!

Ошибка источника:

Строка 57: <body class="corporate"> Строка 58: Строка 59: @Html.Action("Header", "Layout", new {currentPageName = ViewBag.CurrentPageName}) Строка 60: Строка 61: @RenderBody()

Исходный файл: c:\inetpub\wwwroot\prj\Views\Layout_Layout.cshtml Строка: 59

ApplicationException: There is no current user!] Zapros.iFish.<GetCurrentUserAsync>d__10.MoveNext() +333 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62 Abp.Threading.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__51.MoveNext() +700 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62 Zapros.iFish.Sessions.<GetCurrentLoginInformations>d__0.MoveNext() +281 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62 Abp.Threading.<AwaitTaskWithPostActionAndFinallyAndGetResult>d__51.MoveNext() +700 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62 Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task1 task) +48 System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() +108 System.Threading.Tasks.Task.Execute() +71 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +14139120 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62 Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task1 task) +48 Nito.AsyncEx.AsyncContext.Run(Func1 action) +382 Zapros.iFish.Web.Controllers.LayoutController.Header(String currentPageName) +142 lambda_method(Closure , ControllerBase , Object[] ) +139 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +209 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +35 System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +39 System.Web.Mvc.Async.WrappedAsyncResult2.CallEndDelegate(IAsyncResult asyncResult) +67 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +72 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +386 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +42 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +38 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +186 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +65 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +36 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +44 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +65 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38 System.Web.Mvc.<>c__DisplayClass4.<Wrap>b__3() +15 System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +27 System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +1737

[HttpException (0x80004005): Ошибка выполнения дочернего запроса для дескриптора 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.] System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +2392 System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +131 System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +36 System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +595 System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +114 ASP._Page_Views_Layout__Layout_cshtml.Execute() in c:\inetpub\wwwroot\ifish.by\Views\Layout_Layout.cshtml:59 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122 System.Web.WebPages.<>c__DisplayClass3.

I figure out what happend - my issue.

Hi,

I want to sync 2 entites, and create syncronized class. But events is not fired. Could you please tell me what I missed? From my point of view events should fire when I change user settings under top right menu.

public class UserFisherProfileSynchronizer :
        IEventHandler<EntityCreatedEventData<AbpUserBase>>,
        IEventHandler<EntityDeletedEventData<AbpUserBase>>,
        IEventHandler<EntityUpdatedEventData<AbpUserBase>>,
        ITransientDependency
    {
        private readonly IRepository<FisherProfile.FisherProfile, Guid> _fisherProfileRepository;
        private readonly IUnitOfWorkManager _unitOfWorkManager;

        /// <summary>
        /// Constructor
        /// </summary>
        public UserFisherProfileSynchronizer(
            IRepository<FisherProfile.FisherProfile, Guid> fisherProfileRepository,
            IUnitOfWorkManager unitOfWorkManager)
        {
            _fisherProfileRepository = fisherProfileRepository;
            _unitOfWorkManager = unitOfWorkManager;
        }

        /// <summary>
        /// Handles creation event of user
        /// </summary>
        [UnitOfWork]
        public virtual void HandleEvent(EntityCreatedEventData<AbpUserBase> eventData)
        {
            using (_unitOfWorkManager.Current.SetTenantId(null))
            {
                var e = new FisherProfile.FisherProfile()
                {
                    CreatorUserId = eventData.Entity.Id,
                    UserId = eventData.Entity.Id,
                    Email = eventData.Entity.EmailAddress,
                    LastModificationTime = eventData.Entity.LastLoginTime
                };

                if (eventData.Entity is User)
                {
                    e.FirstName = ((User) eventData.Entity).Name;
                    e.LastName = ((User)eventData.Entity).Surname;
                    e.MiddleName = ((User)eventData.Entity).MiddleName;
                    e.MobilePhoneNumbers = ((User)eventData.Entity).PhoneNumber;
                }

                _fisherProfileRepository.Insert(e);
            }
        }

        /// <summary>
        /// Handles deletion event of user
        /// </summary>
        /// <param name="eventData"></param>
        [UnitOfWork]
        public virtual void HandleEvent(EntityDeletedEventData<AbpUserBase> eventData)
        {
            using (_unitOfWorkManager.Current.SetTenantId(null))
            {
                var fisherProfile =
                    _fisherProfileRepository.FirstOrDefault(
                        ua => ua.UserId == eventData.Entity.Id);
                if (fisherProfile != null)
                {
                    _fisherProfileRepository.Delete(fisherProfile);
                }
            }
        }

        /// <summary>
        /// Handles update event of user
        /// </summary>
        /// <param name="eventData"></param>
        [UnitOfWork]
        public virtual void HandleEvent(EntityUpdatedEventData<AbpUserBase> eventData)
        {
            using (_unitOfWorkManager.Current.SetTenantId(null))
            {
                var fisherProfile = _fisherProfileRepository.FirstOrDefault(ua =>  ua.UserId == eventData.Entity.Id);
                if (fisherProfile != null)
                {
                    if (eventData.Entity is User)
                    {
                        fisherProfile.FirstName = ((User)eventData.Entity).Name;
                        fisherProfile.LastName = ((User)eventData.Entity).Surname;
                        fisherProfile.MiddleName = ((User)eventData.Entity).MiddleName;
                        fisherProfile.MobilePhoneNumbers = ((User)eventData.Entity).PhoneNumber;
                    }

                    fisherProfile.Email = eventData.Entity.EmailAddress;
                    fisherProfile.LastModificationTime = eventData.Entity.LastLoginTime;
                    _fisherProfileRepository.Update(fisherProfile);
                }
            }
        }
    }

So, what fix I should to current Asp.Zero code?

Showing 1 to 10 of 26 entries