I get this error when run the project and I can not trace it
Input string was not in a correct format!
this is stack trace
[FormatException: Input string was not in a correct format.]
System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +12099621
System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) +133
System.Convert.ToInt64(String value) +51
Abp.Runtime.Session.AbpSession.get_UserId() +89
Abp.Authorization.<AuthorizeAsync>d__0.MoveNext() +60
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Nito.AsyncEx.<>c__DisplayClass3.<Run>b__1(Task t) +56
System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() +52
System.Threading.Tasks.Task.Execute() +47
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +99
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Nito.AsyncEx.AsyncContext.Run(Func`1 action) +201
Abp.Authorization.AuthorizeAttributeHelper.Authorize(IEnumerable`1 authorizeAttributes) +71
Abp.Authorization.AuthorizeAttributeHelper.Authorize(IAbpAuthorizeAttribute authorizeAttribute) +43
Abp.Web.Mvc.Authorization.AbpMvcAuthorizeAttribute.AuthorizeCore(HttpContextBase httpContext) +85
System.Web.Mvc.AuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext) +160
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +97
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +743
System.Web.Mvc.Async.WrappedAsyncResult`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +14
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +343
System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +25
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +465
System.Web.Mvc.Controller.<BeginExecute>b__14(AsyncCallback asyncCallback, Object callbackState, Controller controller) +18
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +20
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +374
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +16
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +52
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +30
System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +128
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +384
System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
What's wrong with AbpSession UserId ? How Can I Solve the problem?
thank you for reply I read the document but I can't understand one thing:
I want to have a dynamic Navigation system with dynamic accessing rules. How can I implement this by Abp+Zero ?
Is it Possible to have dynamic Permissions?
Is it Possible to define permissions in AbpPermission in database?
I define a permission
public class EPEDCAuthorizationProvider : AuthorizationProvider
{
public override void SetPermissions(IPermissionDefinitionContext context)
{
var administration = context.CreatePermission("Administration", new FixedLocalizableString("Site Admin"), true);
}
}
but it is not stored anywhere ! and All Users are granted for it by default!
How can I define Permissions for specific Roles and Users?
<cite>hikalkan: </cite>
- We should not define states (or routes) if user has no permission to that page. This prevents user to enter to the page by writing url.
how can You check permission in client side?
<cite>hikalkan: </cite> Hi,
You can not get UserId in NavigationProvider since it's executed once on application startup, independent from users.
You can use permissions (instead of roles) to authorize menu items. See Navigation document: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Navigation">http://www.aspnetboilerplate.com/Pages/ ... Navigation</a>
Thank You So Much ! I didn't notice that !
You Are So Fantastic...
I found the problem! The problem is that I want to get Current user Information in NavigationProvider to generate menu items according to user Roles ! and when NavigationProvider Creates menu No user is Logged in.
So my question changed to this:
HOW CAN I GENERATE MENU ACCORDING TO USER ROLES?
Thank You, but User is logged in and U use module-zero
I create it from Templates
this code
Thread.CurrentPrincipal.Identity.GetUserId()
Returns null and
Thread.CurrentPrincipal.Identity.IsAuthenticated
is False !
Why AbpSession.UserId is null in my Application layer? I disabled multytenancy!