Hey Guys,
I hope this forum fits the topic ;-)
First of all I want to thank you again for providing this great framework. I choose the framework because one the one hand I feel that it is stable enough to build my application upon on this and on the other hand it well documented.
However, looking from a ressource based point of view it must be really hard for you to maintain aspnetzero for all the flavors (ASP.NET MVC 5.x, ASP.NET Core 1.x, AngularJS) and adding useful features to it. So I want to start a small discussion about the roadmap or the future of your nice framework.
From my point of view (and I think others who buy the licencse will have the same opinion) I need a stable framework with a solid ecosystem. This includes for me:
For me this framework should be based on the latest technolgoy and should be upgraded frequently so that my team can focus on building line of business applications without the hassle to maintain nuget packages or reinventing wheels. This will allow junior/ mid developers to speed up with software development.
After .NET Core is now out for some month I compared the features that come with aspnetzero and that are included in .NET core. As far as I can see .NET core has a lot of features like DI, Localization, Logging, Caching, etc included and maintained by a huge community. From your perspective it should make sense to use this features and build advanced features/ easier handling for aspnetboilerplate on top of this, right?
Would it be an idea to skip the support of ASP.NET MVC 5.x within the next year and only focus on .NET Core? From an architect perspective you then would be much faster/ better in providing updates and new features.
Maybe it would make also sense to introduce a "user voice" feature to your community in order to ask the people who use the framework which component should be added to the framework?
Best regards
Hello,
I have following abstract class that is derived from the AuditedEntity. From my understanding this should set the CreatorUserId for every new enity without setting it automatically.
public abstract class SalesEntityBase : AuditedEntity<int>, IFullAudited, IMustHaveTenant
{
public int TenantId { get; set; } = 1;
}
And following concrete one:
public class Offer : SalesEntityBase, IOffer
{
public int QutationId { get; set; }
}
I am calling:
var offer = new Offer();
offer.QutationId = 1;
//_offerRepository is default repository derived from IRepository
await _offerRepository.InsertOrUpdateAsync(offer);
However, CreatorUserId is not saved.
Do you have any idea why this is the case?
Hello,
First of all, I want to thank you for all the effort you put into ASP.NET Zero.
I am really happy with the framework and using most of the features out-of-the box in order to reduce my own complexity. The framework works really stable for me. However, I like to do regular updates that you made to the framework.
After upgrading to the latest version I received almost 200 errors. All errors where related to code that comes with ASP.NET Zero that I have never touched (like the UserManager.cs). For fixing these issues I had to gernerate a new project and copy & paste the new code. The overall upgrade process took me a lot of time. I think other users will have the same problem and thus might stick to an old version.
For the next version I think it would be a good idea if you can abstract the code base more and put the code in own .dlls that comes with the ASP.NET Zero framework.
One example could be the ValidationHelper or the TimeZoneService: I see no reason why this code should be in the default .Core template. People would still be able to extend/ overwrite these methods.
What do you think?
Hello, I upgraded v0.10. I noticed that module scanning was removed <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1167#issuecomment-229988957">https://github.com/aspnetboilerplate/as ... -229988957</a>
However, since I have a external module it is not clear for me how I can register this module explicity in the startup class. Is their any other method than using the DependsOn attribute? Something like modules.Add<MyOwnModule>();
Hello,
I have implemented a multi file upload based on a Kendo UI component. Here is my method:
[DisableAuditing]
public ActionResult UploadFiles(IEnumerable<HttpPostedFileBase> files, int offerId)
{
...
}
It worked without any problem. However, I upgraded to v0.10.0.2 and now I receive following error:
Server Error in '/' Application.
Timeouts are not supported on this stream. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Timeouts are not supported on this stream.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Timeouts are not supported on this stream.] System.IO.Stream.get_ReadTimeout() +57
[TargetInvocationException: Property accessor 'ReadTimeout' on object 'System.Web.HttpInputStream' threw the following exception:'Timeouts are not supported on this stream.'] System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component) +525 Abp.Runtime.Validation.Interception.MethodInvocationValidator.ValidateObjectRecursively(Object validatingObject) in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:192 Abp.Runtime.Validation.Interception.MethodInvocationValidator.ValidateObjectRecursively(Object validatingObject) in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:185 Abp.Runtime.Validation.Interception.MethodInvocationValidator.ValidateObjectRecursively(Object validatingObject) in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:154 Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate() in D:\Halil\GitHub\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:85 Abp.Web.Mvc.Validation.AbpMvcValidationFilter.OnActionExecuting(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Validation\AbpMvcValidationFilter.cs:27 System.Web.Mvc.Async.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex) +268 System.Web.Mvc.Async.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex) +1079 System.Web.Mvc.Async.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex) +1079 System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__31(AsyncCallback asyncCallback, Object asyncState) +93 System.Web.Mvc.Async.WrappedAsyncResultBase
1.Begin(AsyncCallback callback, Object state, Int32 timeout) +170 System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList
1 filters, ActionDescriptor actionDescriptor, IDictionary2 parameters, AsyncCallback callback, Object state) +292 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +1167 System.Web.Mvc.Async.WrappedAsyncResultBase
1.Begin(AsyncCallback callback, Object state, Int32 timeout) +170 System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +455 System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +42 System.Web.Mvc.Async.WrappedAsyncVoid1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +67 System.Web.Mvc.Async.WrappedAsyncResultBase
1.Begin(AsyncCallback callback, Object state, Int32 timeout) +170 System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +897 System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +170 System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +711 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +94 System.Web.Mvc.Async.WrappedAsyncVoid
1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +67 System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +170 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +575 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +923 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137
How can I fix this one?
Hello,
I have following problem: I created a module based on the AbpModule. In that module I like to configure recurring jobs with hangfire. A recurring job in this scenario notifies users. I have following code:
[DependsOn(typeof(AbpHangfireModule))]
public class MyModule : AbpModule
{
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
Configuration.BackgroundJobs.UseHangfire(
configuration => { configuration.GlobalConfiguration.UseSqlServerStorage("Default"); });
}
[DisplayName("Provider Reminder for offers that are due {0} hours")]
[AutomaticRetry(Attempts = 0, OnAttemptsExceeded = AttemptsExceededAction.Delete)]
public void OfferReminderJobDefinition(int hours)
{
var reminderService = IocManager.Resolve<IReminderService>();
reminderService.Start(hours);
}
public override void PostInitialize()
{
base.PostInitialize();
RecurringJob.AddOrUpdate("Provider Reminder offer 24 hours", () => OfferReminderJobDefinition(24), Cron.Hourly);
RecurringJob.AddOrUpdate("Provider Reminder offer 36 hours", () => OfferReminderJobDefinition(36), Cron.Hourly);
}
}
The implementation of the IReminder Service looks like:
public class ReminderService : AppServiceBase, IReminderService
{
/// <summary>
/// The _offer service
/// </summary>
private readonly IOfferService _offerService;
/// <summary>
/// The _offer executed action service
/// </summary>
private readonly IOfferExecutedActionService _offerExecutedActionService;
/// <summary>
/// The _qutation service
/// </summary>
private readonly IQutationService _qutationService;
/// <summary>
/// The _routing parameter service
/// </summary>
private readonly IRoutingParameterService _routingParameterService;
private readonly IOfferEmailer _offerEmailer;
/// <summary>
/// The _tenant identifier
/// </summary>
private readonly int _tenantId = 1;
/// <summary>
/// Initializes a new instance of the <see cref="ReminderService"/> class.
/// </summary>
/// <param name="qutationService">The qutation service.</param>
/// <param name="offerService">The offer service.</param>
/// <param name="offerExecutedActionService">The offer executed action service.</param>
/// <param name="offerEmailer"></param>
public ReminderService(IQutationService qutationService, IOfferService offerService,
IOfferExecutedActionService offerExecutedActionService, IOfferEmailer offerEmailer)
{
_qutationService = qutationService;
_offerExecutedActionService = offerExecutedActionService;
_offerService = offerService;
_offerEmailer = offerEmailer;
}
/// <summary>
/// Starts the specified hours.
/// </summary>
/// <param name="hours">The hours.</param>
public async void Start(int hours)
{
await ProcessReminder(hours);
}
...
}
When I start the application the job is registered correct in hangfire. Also the first call/ job execution works without any problems. However, the next execution fails with following error:
Failed An exception occurred during processing of a background job.
Castle.MicroKernel.ComponentNotFoundException
No component for supporting the service MyModule was found Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service MyModule was found at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) at Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments) at Castle.Windsor.WindsorContainer.Resolve(Type service) at Abp.Dependency.IocManager.Resolve(Type type) at Abp.Hangfire.HangfireIocJobActivator.ActivateJob(Type jobType) at Abp.Hangfire.HangfireIocJobActivator.HangfireIocJobActivatorScope.Resolve(Type type) at Hangfire.Server.CoreBackgroundJobPerformer.Perform(PerformContext context) at Hangfire.Server.BackgroundJobPerformer.<>c__DisplayClass8_0.<PerformJobWithFilters>b__0() at Hangfire.Server.BackgroundJobPerformer.InvokePerformFilter(IServerFilter filter, PerformingContext preContext, Func
1 continuation) at Hangfire.Server.BackgroundJobPerformer.<>c__DisplayClass8_1.<PerformJobWithFilters>b__2() at Hangfire.Server.BackgroundJobPerformer.PerformJobWithFilters(PerformContext context, IEnumerable
1 filters) at Hangfire.Server.BackgroundJobPerformer.Perform(PerformContext context) at Hangfire.Server.Worker.PerformJob(BackgroundProcessContext context, IStorageConnection connection, String jobId)
It looks like as if the Module forget the dependency. Do you know why that happens and how I can get rid of it?
Hi,
I am using hangfire for jobs. In my dev environment I can open /dashboard to access my hangfire dashboard. However, in production my admin user does not have access to that page. According to <a class="postlink" href="http://docs.hangfire.io/en/latest/configuration/using-dashboard.html">http://docs.hangfire.io/en/latest/confi ... board.html</a> it is possible to integrate a custom auth system with hangfire. However, I have no clue how to combine the ABP Framework user management system with hangfire. Do you have any idea?
Hello,
as I learnt I have to register jobs in the post init event:
public override void PostInitialize()
{
base.PostInitialize();
var workManager = IocManager.Resolve<IBackgroundWorkerManager>();
workManager.Add(IocManager.Resolve<MakeInactiveUsersPassiveWorker>());
}
However, would it be possible to automatic register all jobs that implement an specific interface (like you do for WebApi Service?). I think that would further increase productivity.
Thank you
Hello,
I have following code:
public class OfferFileController : AbpController
{
private readonly ILogger _logger;
private readonly IMapper _mapper;
private readonly IOfferFileService _offerFileService;
private readonly IOfferService _offerService;
private readonly UserManager _userManager;
public OfferFileController(IOfferService offerService, UserManager userManager,
IOfferFileService offerFileService,
IMapper mapper,
ILogger logger)
{
_offerService = offerService;
_offerFileService = offerFileService;
_userManager = userManager;
_mapper = mapper;
_logger = logger;
}
public ActionResult UploadFiles(IEnumerable<HttpPostedFileBase> files, int offerId)
{
// The Name of the Upload component is "files"
if (files != null)
{
foreach (var file in files)
{
var offerFile = new OfferFile();
var fileName = Path.GetFileName(file.FileName);
//Check if file exist
offerFile = _offerFileService.GetByNameAndOfferId(fileName, offerId) ?? new OfferFile();
offerFile.Name = fileName;
offerFile.FileType = file.ContentType;
offerFile.OfferId = offerId;
using (var binaryReader = new BinaryReader(file.InputStream))
{
offerFile.File = binaryReader.ReadBytes(file.ContentLength);
}
//Save
_offerFileService.Save(offerFile);
}
}
// Return an empty string to signify success
return Content("");
}
When I pass a file I receive
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Abp.Web.Mvc.Controllers.AbpController.ConvertArgumentsToJson(IDictionary`2 arguments) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Controllers\AbpController.cs:515
Abp.Web.Mvc.Controllers.AbpController.HandleAuditingBeforeAction(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Controllers\AbpController.cs:428
Abp.Web.Mvc.Controllers.AbpController.OnActionExecuting(ActionExecutingContext filterContext) in D:\Halil\GitHub\aspnetboilerplate\src\Abp.Web.Mvc\Web\Mvc\Controllers\AbpController.cs:299
However, if I replace the AbpController with the default Controller (meaning public class OfferFileController : Controller) it works. Do you have any idea why this happens?
Hello, I hove following entities:
public class Provider : EntityBase
{
[Column(Order = 120)]
public string Name { get; set; }
public virtual ICollection<Country> Countries { get; set; }
}
public class Country :EntityBase
{
[MaxLength(100)]
public string Name { get; set; }
[MaxLength(10)]
public string Code { get; set; }
}
And following configuration:
public class ProviderConfiguration : EntityTypeConfiguration<Provider>
{
public ProviderConfiguration()
{
HasMany(m => m.Countries)
.WithMany()
.Map(m =>
{
m.MapLeftKey("ProviderId");
m.MapRightKey("CountryId");
m.ToTable("Provider_Countries");
});
}
}
That means a provider can have several countries. The table in sql server look good and as far as I know that is the recommended method to build up many to many relationship. However, when I try to save the children only my provider entity is saved and the children are not saved to the "Provider_Countries" table:
public ProviderService(IRepository<Provider> providerRepository, IRepository<Country> countryRepository)
{
_providerRepository = providerRepository;
_countryRepository = countryRepository;
}
public async Task SaveAsync(Provider provider)
{
var entity = provider;
var countriesToAdd = provider.Countries.ToList();
//Clear existing entities
entity.Countries.Clear();
foreach (var countryToAdd in countriesToAdd)
{
var country = _countryRepository.Get(countryToAdd.Id);
entity.Countries.Add(country);
}
_providerRepository.InsertOrUpdate(entity);
await CurrentUnitOfWork.SaveChangesAsync();
}
Based on the topics I found on the internet that is the recommended approach how to save a many to many relationship. Do you have any idea how I can save the child items?