@aaron @ismcagdas thank you both for your help so far.
I can confirm that I am currently using TimeZoneConverter 2.3.1. Is the recommendation to be using 2.4.1? Is it as simple as updating this single package? Or are there other packages that I would also need to update?
Thanks
@ismcagdas Can you provide any additional information in order for me to answer your question? Thanks. I would really like to get to the bottom of this problem.
Naive question...
How would I know that?
Thank you for getting back to me!
That information will be very useful, appreciate your time.
Gary
ismcagdas thank you again! I have just given the _session.Use a try, and it seems to work exactly as I was hoping.
Thanks again!
<cite>ismcagdas: </cite> If you want to make operations on behalf of a user, you can use <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Abp-Session#user-identifier">https://aspnetboilerplate.com/Pages/Doc ... identifier</a>.
Sorry, I am not sure if I follow. Do you have an example of where/when this can be used? Within the Windows Service, I want to be able to "log in" as a user of the system, so that any modifications to the data can be tracked back to where they came form. In this case, we will likely create an account in the system that the Windows Service will use to login to the application, prior to making any changes.
Thanks again!
@ismcagdas thank you for pointing me that the Migrator project. I was able to follow it's module, including the setup of the ServiceCollectionRegistrar, and I was able to get instances of my service being returned from the container.
Thank you very much!
As a follow up question though...
When I try to call the GetAll method on one of my services, I get an exception saying:
Current user did not login to the application.
I have been able to workaround this for now by setting:
Configuration.Authorization.IsEnabled = true;
In my module, but this is far from ideal. Can you point me at where I would Login with a set of credentials to allow all interactions to happen using that user?
@ismcagdas that gets me one step further, I think...
The call to bootstrapper.Initialize() seems to start, but then it gets to this Initialize line in this code:
public override void PostInitialize()
{
IocManager.RegisterIfNot<IChatCommunicator, NullChatCommunicator>();
IocManager.Resolve<ChatUserStateWatcher>().Initialize();
IocManager.Resolve<AppTimes>().StartupTime = Clock.Now;
}
Which is in the MySampleProjectCoreModule, and it just bombs out.
Any ideas?
@ismcagdas I have kept that module very simple, as per the example that was given.
It contains the following
[DependsOn(typeof(MySampleApplicationApplicationModule))]
public class MySampleApplicationServiceModule : AbpModule
{
public override void Initialize()
{
IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
}
}
Based on my reading, I "think" the correct way to do this is:
var bootstrapper = new AbpBootstrapper.Create<MySampleProjectApplicationModule>();
bootstrapper.Initialize();
and from there, I could do:
var myService = bootstrapper.IocManager.Resolve<IMyService>();
Is this the correct approach? When I try the above, I get an error message at the Initialize step:
Can't create component 'Abp.BackgroundJobs.BackgroundJobStore' as it has dependencies to be satisfied.
'Abp.BackgroundJobs.BackgroundJobStore' is waiting for the following dependencies:
- Service 'Abp.Domain.Repositories.IRepository`2[[Abp.BackgroundJobs.BackgroundJobInfo, Abp, Version=3.4.0.0, Culture=neutral, PublicKeyToken=null],[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' which was not registered.
Any ideas on what I need to do to correct this problem?
I have added a reference to the Abp NuGet Package, which I thought was the issue, but looks like it is something else.
Thanks in advance!