Hello!
I need to use localization for my enums with annotation to use with dropdownlists, but i cant figure it out.
Aaron has described it like this:
public enum OrderByOptions
{
[AbpDisplayName(MyConsts.LocalizationSourceName, "OrderByOptions.Default")]
Default,
[AbpDisplayName(MyConsts.LocalizationSourceName, "OrderByOptions.PriceLowToHigh")]
PriceLowToHigh,
[AbpDisplayName(MyConsts.LocalizationSourceName, "OrderByOptions.PriceHighToLow")]
PriceHighToLow,
[AbpDisplayName(MyConsts.LocalizationSourceName, "OrderByOptions.MostRecent")]
MostRecent
}
Copied from this post: https://stackoverflow.com/a/46642292
But i get validation error saying that this attribute is not valid on this declaration type, only valid on 'class, method, property, indexer, event' declarations.
Any solution? Thanks in advance!
There is no solution/workaround for this, even if you do not need to use the hierarchic function in the scopes? Just need "Defined or Default" per OU.
Hello!
Is there any way to use the prebuilt Settingsmanager to add settings specific to organizationUnits instead of just per user, host or tenant? I cant find any relevant documentation about it.
Thanks!
<a class="postlink" href="https://snag.gy/x73GIM.jpg">https://snag.gy/x73GIM.jpg</a>
The error doesnt mention any specific dependencies.. This is the complete exception:
Castle.MicroKernel.Handlers.HandlerException: Can't create component 'BVServiceReference.WSCETestSoapClient' as it has dependencies to be satisfied.
vid Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
vid Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
vid Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernelByType(CreationContext context, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernel(CreationContext context, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveCore(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context)
vid Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)
vid Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)
vid Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)
vid Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)
vid Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)
vid Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
vid Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
vid Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernelByType(CreationContext context, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernel(CreationContext context, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveCore(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)
vid Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context)
vid Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)
vid Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)
vid Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)
vid Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)
vid Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)
vid Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
vid Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
vid Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
vid Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy)
vid Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy)
vid Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments)
vid Castle.Windsor.WindsorContainer.Resolve(Type service)
vid Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.ResolveInstanceOrNull(Type serviceType, Boolean isOptional)
vid Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetServiceInternal(Type serviceType, Boolean isOptional)
vid Castle.Windsor.MsDependencyInjection.ScopedWindsorServiceProvider.GetRequiredService(Type serviceType)
vid Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
vid Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
vid Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController0(ControllerContext controllerContext)
vid Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
vid Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__14.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__23.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ExceptionContext context)
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextResourceFilter>d__22.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeFilterPipelineAsync>d__17.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeAsync>d__15.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid Microsoft.AspNetCore.Builder.RouterMiddleware.<Invoke>d__4.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid Microsoft.AspNetCore.Owin.WebSocketAcceptAdapter.<>c__DisplayClass6_0.<<AdaptWebSockets>b__0>d.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.<Invoke>d__4.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.GetResult()
vid MyApp.Web.Authentication.JwtBearer.JwtTokenMiddleware.<>c.<<UseJwtTokenMiddleware>b__0_0>d.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
vid Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()
--- Slut på stackspårningen från föregående plats där ett undantag utlöstes ---
vid System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
vid System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
vid Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.<Invoke>d__7.MoveNext()
Yes, i did. Like this:
IocManager.Register<System.ServiceModel.EndpointAddress>(DependencyLifeStyle.Transient);
IocManager.Register<System.ServiceModel.Channels.Binding>(DependencyLifeStyle.Transient);
After that i get this error:
HandlerException: Can't create component 'BVServiceReference.WSCETestSoapClient' as it has dependencies to be satisfied.
Thanks. But now the errors continue down the chain.
'BVServiceReference.WSCETestSoapClient' is waiting for the following dependencies:
- Parameter 'endpointConfiguration' which was not provided. Did you forget to set the dependency?
- Parameter 'remoteAddress' which was not provided. Did you forget to set the dependency?
- Service 'System.ServiceModel.EndpointAddress' which was not registered.
- Service 'System.ServiceModel.Channels.Binding' which was not registered
This is the WSCETestSoapClient-class:
public partial class WSCETestSoapClient : System.ServiceModel.ClientBase<BVServiceReference.WSCETestSoap>, BVServiceReference.WSCETestSoap, ITransientDependency
{
/// <summary>
/// Implement this partial method to configure the service endpoint.
/// </summary>
/// <param name="serviceEndpoint">The endpoint to configure</param>
/// <param name="clientCredentials">The client credentials</param>
static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials);
public WSCETestSoapClient(EndpointConfiguration endpointConfiguration) :
base(WSCETestSoapClient.GetBindingForEndpoint(endpointConfiguration), WSCETestSoapClient.GetEndpointAddress(endpointConfiguration))
{
this.Endpoint.Name = endpointConfiguration.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
public WSCETestSoapClient(EndpointConfiguration endpointConfiguration, string remoteAddress) :
base(WSCETestSoapClient.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress))
{
this.Endpoint.Name = endpointConfiguration.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
public WSCETestSoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
base(WSCETestSoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
{
this.Endpoint.Name = endpointConfiguration.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
public WSCETestSoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
base(binding, remoteAddress)
{
}
public System.Threading.Tasks.Task<BVServiceReference.STRUCGrundfraga> GrundfragaAsync(string Regnr, string UserID, string Password)
{
return base.Channel.GrundfragaAsync(Regnr, UserID, Password);
}
public System.Threading.Tasks.Task<BVServiceReference.STRUCTeknikfraga> TeknikfragaAsync(string Regnr, string UserID, string Password)
{
return base.Channel.TeknikfragaAsync(Regnr, UserID, Password);
}
public System.Threading.Tasks.Task<BVServiceReference.STRUCTeknikfragaNY> TeknikfragaV2Async(string Regnr, string UserID, string Password)
{
return base.Channel.TeknikfragaV2Async(Regnr, UserID, Password);
}
public System.Threading.Tasks.Task<BVServiceReference.STRUCDispensFraga> DispensfragaAsync(string Regnr, string UserID, string Password, string Sidref)
{
return base.Channel.DispensfragaAsync(Regnr, UserID, Password, Sidref);
}
public System.Threading.Tasks.Task<BVServiceReference.StrucForegaendeAgareFraga> ForegaendeAgarefragaAsync(string Regnr, string UserID, string Password, string Sidref)
{
return base.Channel.ForegaendeAgarefragaAsync(Regnr, UserID, Password, Sidref);
}
public System.Threading.Tasks.Task<BVServiceReference.StrucForegaendeAgareFragaV2> ForegaendeAgarefragaV2Async(string Regnr, string UserID, string Password, string Sidref)
{
return base.Channel.ForegaendeAgarefragaV2Async(Regnr, UserID, Password, Sidref);
}
public System.Threading.Tasks.Task<BVServiceReference.StrucBesiktningsFraga> BesiktningsfragaAsync(string Regnr, string UserID, string Password, string Sidref)
{
return base.Channel.BesiktningsfragaAsync(Regnr, UserID, Password, Sidref);
}
public virtual System.Threading.Tasks.Task OpenAsync()
{
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen));
}
public virtual System.Threading.Tasks.Task CloseAsync()
{
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndClose));
}
private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
{
if ((endpointConfiguration == EndpointConfiguration.WSCETestSoap))
{
System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.WSCETestSoap12))
{
System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
result.Elements.Add(textBindingElement);
System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
httpsBindingElement.AllowCookies = true;
httpsBindingElement.MaxBufferSize = int.MaxValue;
httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
result.Elements.Add(httpsBindingElement);
return result;
}
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
}
private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration)
{
if ((endpointConfiguration == EndpointConfiguration.WSCETestSoap))
{
return new System.ServiceModel.EndpointAddress("https://www1.bilvision.se/wsce/wsceTest.asmx");
}
if ((endpointConfiguration == EndpointConfiguration.WSCETestSoap12))
{
return new System.ServiceModel.EndpointAddress("https://www1.bilvision.se/wsce/wsceTest.asmx");
}
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
}
public enum EndpointConfiguration
{
WSCETestSoap,
WSCETestSoap12,
}
}
Hello!
I have added a webService to my application. But when i try to use this service as Dependency Injection i get an error:
'MyApp.BilvisionService.BilvisionAppService' is waiting for the following dependencies:
- Service 'BVServiceReference.WSCETestSoap' which was not registered.
How can i register this webService?
Kind regards!
Hi!
Read this: <a class="postlink" href="https://www.softfluent.com/blog/dev/Page-redirection-and-URL-Rewriting-with-ASP-NET-Core">https://www.softfluent.com/blog/dev/Pag ... P-NET-Core</a>
Hi!
I have extended the OrganizationUnit entity, and also added a reference (one-to-one) to another entity. The child entity inherits the filter, FullAuditedEntity. But when i delete the organizationUnit only the OrganizationUnit is softdeleted, nothing happens to the child entity. I have tried using both the OrganizationUnitManager and also my newly created Appservice for the extended entity for the delete task, but no difference.
public async Task DeleteMyExtendedOU(long id)
{
await _myExtendedOURepository.DeleteAsync(id);
}