Base solution for your next web application

Activities of "cangunaydin"

Hello, I have downloaded and migrated my project to the new release but still i am getting this error. Here is the error from the logfile.

ERROR 2017-02-17 14:53:26,236 [14   ] Microsoft.AspNetCore.Server.Kestrel      - Connection id "0HL2N5D0VKP1A": An unhandled exception was thrown by the application.
System.NotSupportedException: The invoked member is not supported in a dynamic assembly.
   at System.Reflection.Emit.InternalAssemblyBuilder.get_Location()
   at Microsoft.AspNet.SignalR.Hubs.ReflectedHubDescriptorProvider.GetTypesSafe(Assembly a)
   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Microsoft.AspNet.SignalR.Hubs.ReflectedHubDescriptorProvider.BuildHubsCache()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at Microsoft.AspNet.SignalR.Hubs.ReflectedHubDescriptorProvider.GetHubs()
   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.&lt;GetEnumerator&gt;d__1.MoveNext()
   at Microsoft.AspNet.SignalR.Hubs.DefaultJavaScriptProxyGenerator.GenerateProxy(IHubManager hubManager, IJavaScriptMinifier javaScriptMinifier, Boolean includeDocComments)
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at Microsoft.AspNet.SignalR.Hubs.DefaultJavaScriptProxyGenerator.GenerateProxy(String serviceUrl)
   at Microsoft.AspNet.SignalR.Hubs.HubDispatcher.ProcessRequest(HostContext context)
   at Microsoft.Owin.Cors.CorsMiddleware.&lt;Invoke&gt;d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Owin.Mapping.MapMiddleware.&lt;Invoke&gt;d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Owin.WebSocketAcceptAdapter.&lt;&gt;c__DisplayClass6_0.&lt;&lt;AdaptWebSockets&gt;b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.<Invoke>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.&lt;Invoke&gt;d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.&lt;Invoke&gt;d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.&lt;Invoke&gt;d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.&lt;Invoke&gt;d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.&lt;Invoke&gt;d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1.<RequestProcessingAsync>d__2.MoveNext()
Question

Hello, I am using Angular 2 with .Net Core Project. After a long time, in the server side i am getting this error.

ERROR 2017-02-05 12:18:16,574 [4    ] Mvc.ExceptionHandling.AbpExceptionFilter - Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at ByteBrick.MagicInfoConfig.Friendships.Cache.UserFriendsCache.GetCacheItem(UserIdentifier userIdentifier) in D:\dev\vs\dotnetcore\MagicInfoConfig\Server\src\ByteBrick.MagicInfoConfig.Core\Friendships\Cache\UserFriendsCache.cs:line 44
   at Castle.Proxies.Invocations.UserFriendsCache_GetCacheItem.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformSyncUow(IInvocation invocation, UnitOfWorkOptions options)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.UserFriendsCacheProxy.GetCacheItem(UserIdentifier userIdentifier)
   at ByteBrick.MagicInfoConfig.Chat.ChatAppService.GetUserChatFriendsWithSettings() in D:\dev\vs\dotnetcore\MagicInfoConfig\Server\src\ByteBrick.MagicInfoConfig.Application\Chat\ChatAppService.cs:line 41
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()

Is it because my session is ended after a while? cause userIdentifier object is posted to the server side from the client as null value.

Hello thank you for the effort, is there any progress for this problem? i did the first step of the solution but i am still getting the same error.

Question

Hello, I am using Asp.Net Zero Core and Angular2 project. When i built it first time it connects to signalr and there is no problem with the connection. But after rebuilds for both ui and .net core end, sometimes it doesn't connect to signalr hub and gives an 500 internal error for the link <a class="postlink" href="http://localhost:22742/signalr/hubs?=1485624235544">http://localhost:22742/signalr/hubs?=1485624235544</a> from the console of the web browser.

I use VS Code for the ui and VS 2015 for the .net core project. Do you have any idea about what can be the problem?

Oh thank you for the reply. Now it is all clear. I was searching for that.

Hello, I am just curious how the ui states in angularjs application can render .cshtml files, partial views? Are there any extension for that? Because as i know it needs to go to the server side to render the html isn't it so?

Ok sorry for the message i have just missed the part in development guide.

While Nswag automatically generate proxy files, it does not refresh service-proxies.module.ts. If you add a new service, you should manually add it to this file as like others.

so i need to add it there. If someone is having the same problem maybe it can help.

Hello, I have a problem with dependency injection in angular2 project. I have created couple of services in my application project all the appservice classes is implemented from i applicationservice interface and i can see that my methods are working from swagger ui i can do posts or gets to my methods. In the UI project i have run refresh.bat inside nswag folder and it regenerated the methods for me now i can see the components when i import the '@shared/service-proxies/service-proxies' but when i inject them to the constructor of any component. It is giving me an error on runtime. 'No provider for GroupServiceProxy! ; Zone: angular ; Task: Promise.then ; Value:', it feels like it can not inject the http service inside service-proxies but i don't know why. Here is the detailed example below.

GroupAppService:

[AbpAuthorize(AppPermissions.Pages_Tenant_Groups)]
    public class GroupAppService : MagicInfoConfigAppServiceBase, IGroupAppService
    {
        private readonly IRepository<Group> _groupRepository;
        private readonly IAppFolders _appFolders;
        public GroupAppService(IAppFolders appFolders, IRepository<Group> groupRepository)
        {
            _appFolders = appFolders;
            _groupRepository = groupRepository;
        }
        [AbpAuthorize(AppPermissions.Pages_Tenant_Groups_Create)]
        public async Task CreateGroup(CreateGroupInput input)
        {
            var group = input.MapTo<Group>();
            await _groupRepository.InsertAndGetIdAsync(group);
        }

        public async Task<PagedResultDto<GroupListDto>> GetGroups(GetGroupInput input)
        {

            var query = _groupRepository
              .GetAll().Include(g => g.Address)
              .WhereIf(
                  !input.Filter.IsNullOrEmpty(),
                  p => p.Name.Contains(input.Filter) ||
                          p.ServerUrl.Contains(input.Filter) ||
                          p.Address.Name.Contains(input.Filter)
              );
            var groupCount = await query.CountAsync();
            var groups = await query
                .OrderBy(input.Sorting)
                .PageBy(input)
                .ToListAsync();

            var groupListDtos = groups.MapTo<List<GroupListDto>>();

            return new PagedResultDto<GroupListDto>(
                 groupCount,
                 groupListDtos
                 );
        }

        [AbpAuthorize(AppPermissions.Pages_Tenant_Groups_Delete)]
        public async Task DeleteGroup(EntityDto input)
        {
            await _groupRepository.DeleteAsync(input.Id);
        }

      


    }

IGroupAppService:

public interface IGroupAppService : IApplicationService
    {
        Task<PagedResultDto<GroupListDto>> GetGroups(GetGroupInput input);
        Task CreateGroup(CreateGroupInput input);

        Task DeleteGroup(EntityDto input);

    }

and the last thing angular2 component coming as default with asp.net zero. I am trying to inject the groupService inside. Dashboard.component.ts:

import { Component, Injector, AfterViewInit } from '@angular/core';
import { TenantDashboardServiceProxy,GroupServiceProxy } from '@shared/service-proxies/service-proxies';
import { AppComponentBase } from '@shared/common/app-component-base';
import { appModuleAnimation } from '@shared/animations/routerTransition';

@Component({
    templateUrl: './dashboard.component.html',
    animations: [appModuleAnimation()]
})
export class DashboardComponent extends AppComponentBase implements AfterViewInit {

    constructor(
        injector: Injector,
        private _dashboardService: TenantDashboardServiceProxy,
        private _groupService:GroupServiceProxy
    ) {
        super(injector);
    }

    ngAfterViewInit(): void {
        
        Morris.Area({
            element: 'sales_statistics',
            padding: 0,
            behaveLikeLine: false,
            gridEnabled: false,
            //gridLineColor: false,
            axes: false,
            fillOpacity: 1,
            data: [
                {
                    period: '2011 Q1',
                    sales: 1400,
                    profit: 400
                }, {
                    period: '2011 Q2',
                    sales: 1100,
                    profit: 600
                }, {
                    period: '2011 Q3',
                    sales: 1600,
                    profit: 500
                }, {
                    period: '2011 Q4',
                    sales: 1200,
                    profit: 400
                }, {
                    period: '2012 Q1',
                    sales: 1550,
                    profit: 800
                }
            ],
            lineColors: ['#399a8c', '#92e9dc'],
            xkey: 'period',
            ykeys: ['sales', 'profit'],
            labels: ['Sales', 'Profit'],
            pointSize: 0,
            lineWidth: 0,
            hideHover: 'auto',
            resize: true
        });

        this.getMemberActivity();
    }
    test():void{
        this._groupService.deleteGroup(1).subscribe(result=>{
                alert("subscribed");
        });
    }
    getMemberActivity(): void {
        this._dashboardService
            .getMemberActivity()
            .subscribe(result => {
                $("#totalMembersChart").sparkline(result.totalMembers, {
                    type: 'bar',
                    width: '100',
                    barWidth: 6,
                    height: '45',
                    barColor: '#F36A5B',
                    negBarColor: '#e02222',
                    chartRangeMin: 0
                });

                $("#newMembersChart").sparkline(result.newMembers, {
                    type: 'bar',
                    width: '100',
                    barWidth: 6,
                    height: '45',
                    barColor: '#5C9BD1',
                    negBarColor: '#e02222',
                    chartRangeMin: 0
                });
            });
    };
}
Answer

Thank you, I will try it.

Actually i was talking about the .html file

<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/c2f52042bd74e1d29674b33f4a75dde944441fd2/angular/src/app/shared/layout/profile/change-profile-picture-modal.component.html">https://github.com/aspnetzero/aspnet-ze ... onent.html</a>

below here you can see that you are calling hide() function which is not in component.ts

<button type="button" class="close" aria-label="Close" (click)="hide()">
          				<span aria-hidden="true">&times;</span>
        			</button>

And when i run the project it doesn't close the modal when i click that. I have the latest version that i have downloaded 2 days ago.

Also saving variable is in .html file, you can see it below.

<button type="button" class="btn default close-button" (click)="close()" [disabled]="saving">{{l("Cancel")}}</button>
					<button type="submit" class="btn blue save-button" [disabled]="!changeProfilePictureModalForm.form.valid || saving"><i class="fa fa-save"></i> <span>{{l("Save")}}</span></button>

but there is no variable called saving in the component.ts.

If it is global or coming from the inherited class i don't know but on click it doesn't close the modal for sure in my app :)

Showing 161 to 170 of 183 entries