Base solution for your next web application

Activities of "gep13"

Hello,

We have just downloaded the default ASP.NET Core + jQuery project of ASP.NET Zero, and we are running into issues running the .\build-mvc.ps1 and then the subsequent .\up.ps1 file.

The environment that I am running on is as follows:

dotnet --info

.NET Command Line Tools (2.1.4)

Product Information: Version: 2.1.4 Commit SHA-1 hash: 5e8add2190

Runtime Environment: OS Name: Windows OS Version: 10.0.16299 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.1.4\

Microsoft .NET Core Shared Framework Host

Version : 2.0.5 Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54

docker --version

Docker version 17.12.0-ce, build c97c6d6

I can successfully run the .\build.ps1 file, and the Mvc and Public folder are created in the outputs folder, without any problems. However, when I run the .\up.ps1 file, I get the following:

Creating outputs_zero_mvc_1 ... done Creating outputs_zero_public_1 ... done

And then nothing.

If I run docker compose directly, rather than trying to run in the background, I get a little bit more information, which is:

Starting outputs_zero_public_1 ... Starting outputs_zero_public_1 ... done Attaching to outputs_zero_mvc_1, outputs_zero_public_1 zero_mvc_1 | Did you mean to run dotnet SDK commands? Please install dotnet SDK from: zero_mvc_1 | <a class="postlink" href="http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409">http://go.microsoft.com/fwlink/?LinkID= ... lcid=0x409</a> zero_public_1 | Did you mean to run dotnet SDK commands? Please install dotnet SDK from: zero_public_1 | <a class="postlink" href="http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409">http://go.microsoft.com/fwlink/?LinkID= ... lcid=0x409</a> outputs_zero_mvc_1 exited with code 145

Do you have any ideas about what is going on here? Is there anything that I need to change?

Thanks

Gary

Hello,

Thank you for taking the time to respond.

I have done what you suggested. Both the Mvc-Logs and Public-Logs folder are empty after trying to run the .\up.ps1 file.

If I run the command docker logs outputs_zero_mvc_1 then I get the following output:

Did you mean to run dotnet SDK commands? Please install dotnet SDK from: <a class="postlink" href="http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409">http://go.microsoft.com/fwlink/?LinkID= ... lcid=0x409</a>

Which is the same output as posted above.

Can you suggest anything else that I should try?

Thanks

Gary

Hello,

I am trying to utilise the services, repositories, entity framework connection, that are used in the ASP.NET Zero Application, in another application. This is a Windows Service, and we want to use the same code to access the database that is used within the MVC application.

I have referenced all the necessary projects in my Windows Service, and I have been able to instantiate the service, and it successfully makes a call to the GetAll method. However, when it then tries to map the entity to the Dto, I get an error message:

Abp.ObjectMapping.IObjectMapper should be implemented in order to map objects

How can I go about passing the required mappings into the service layer for it to be used.

Thanks in advance.

Gary

Thank you for taking the time to respond.

I am still not sure if I understand...

I have went ahead and created a Module as you suggested, but the PreInitialize and Initialize override methods are never called. In my Windows Service, I don't have the Castle Windsor DI System. Where should I configure the Abp Modules, so that they are initialized within my application?

Thanks

Gary

Thank you for taking the time to respond.

I am going to give this a try just now. Once I have initialized the bootstrapper as you have suggested, how can I then resolve an instance of a particular service, so use within my Windows Service?

Thanks

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!

@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());
        }
    }

@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 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?

<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!

Showing 1 to 10 of 43 entries