We can't provide much help on the question of calling Microsoft APIs. I recommend that you check Microsoft's document. : )
hi @shobhit
Can I check remotely? liming.ma@volosoft.com
hi
This is my test application service.
It works, but there will be a few exceptions. My local mongodb will not get an exception. I think it may be caused by your mongodb.
/* Inherit your application services from this class.
*/
public abstract class MyAppAppService : ApplicationService
{
protected MyAppAppService()
{
LocalizationResource = typeof(MyAppResource);
}
}
public enum ImportTableName
{
Test1 = 1,
Test2 = 2
}
[BackgroundJobName("ImportJob")]
public class BackgroundImportJobArgs
{
public string FilePath { get; set; }
public ImportTableName ImportTableName { get; set; }
}
public interface IImportTblAppService : IApplicationService
{
Task AddTest1(string filePath, ImportTableName tablename);
}
public class BackgroundImportJob : AsyncBackgroundJob<BackgroundImportJobArgs>, ITransientDependency
{
private readonly IImportTblAppService importTbl;
public BackgroundImportJob(IImportTblAppService importTbl)
{
this.importTbl = importTbl;
}
public override async Task ExecuteAsync(BackgroundImportJobArgs args)
{
Console.WriteLine("ExecuteAsync");
await importTbl.AddTest1(args.FilePath, args.ImportTableName);
}
}
public class ImportTblAppService : MyAppAppService, IImportTblAppService
{
private readonly IBackgroundJobManager _backgroundJobManager;
public ImportTblAppService(IBackgroundJobManager backgroundJobManager)
{
_backgroundJobManager = backgroundJobManager;
}
public Task AddTest1(string filePath, ImportTableName tablename)
{
Console.WriteLine("AddTest1");
return Task.CompletedTask;
}
public async Task ScheduleImportJob(string filePath, ImportTableName tablename)
{
await _backgroundJobManager.EnqueueAsync(new BackgroundImportJobArgs { FilePath = filePath, ImportTableName = tablename });
}
}
[20:10:03 ERR] An exception occurred while receiving a message from the server.
MongoDB.Driver.MongoConnectionException: An exception occurred while receiving a message from the server.
---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of tim
e, or established connection failed because connected host has failed to respond..
---> System.Net.Sockets.SocketException (10060): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection f
ailed because connected host has failed to respond.
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
at System.Net.Security.SslStream.<FillBufferAsync>g__InternalFillBufferAsync|215_0[TReadAdapter](TReadAdapter adap, ValueTask`1 task, Int32 min, Int32 initial)
at System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)
at MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadAsync(Stream stream, Byte[] buffer, Int32 offset, Int32 count, TimeSpan timeout, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Misc.StreamExtensionMethods.ReadBytesAsync(Stream stream, Byte[] buffer, Int32 offset, Int32 count, TimeSpan timeout, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveBufferAsync(CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at MongoDB.Driver.Core.Connections.BinaryConnection.ReceiveMessageAsync(Int32 responseTo, IMessageEncoderSelector encoderSelector, MessageEncoderSettings messageEncoderSettings, C
ancellationToken cancellationToken)
at MongoDB.Driver.Core.WireProtocol.CommandUsingQueryMessageWireProtocol`1.ExecuteAsync(IConnection connection, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocolAsync[TResult](IWireProtocol`1 protocol, ICoreSession session, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.RetryableWriteOperationExecutor.ExecuteAsync[TResult](IRetryableWriteOperation`1 operation, RetryableWriteContext context, CancellationToken canc
ellationToken)
at MongoDB.Driver.Core.Operations.BulkUnmixedWriteOperationBase`1.ExecuteBatchAsync(RetryableWriteContext context, Batch batch, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.BulkUnmixedWriteOperationBase`1.ExecuteBatchesAsync(RetryableWriteContext context, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.ExecuteBatchAsync(RetryableWriteContext context, Batch batch, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)
at MongoDB.Driver.OperationExecutor.ExecuteWriteOperationAsync[TResult](IWriteBinding binding, IWriteOperation`1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.ExecuteWriteOperationAsync[TResult](IClientSessionHandle session, IWriteOperation`1 operation, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.BulkWriteAsync(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSessionAsync[TResult](Func`2 funcAsync, CancellationToken cancellationToken)
at MongoDB.Driver.MongoCollectionBase`1.InsertOneAsync(TDocument document, InsertOneOptions options, Func`3 bulkWriteAsync)
at Volo.Abp.Domain.Repositories.MongoDB.MongoDbRepository`2.InsertAsync(TEntity entity, Boolean autoSave, CancellationToken cancellationToken)
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
at Volo.Abp.BackgroundJobs.BackgroundJobStore.InsertAsync(BackgroundJobInfo jobInfo)
at Volo.Abp.BackgroundJobs.DefaultBackgroundJobManager.EnqueueAsync(String jobName, Object args, BackgroundJobPriority priority, Nullable`1 delay)
at Volo.Abp.BackgroundJobs.DefaultBackgroundJobManager.EnqueueAsync[TArgs](TArgs args, BackgroundJobPriority priority, Nullable`1 delay)
at MyApp.ImportTblAppService.ScheduleImportJob(String filePath, ImportTableName tablename) in C:\Users\maliming\Desktop\New folder (2)\src\MyApp.Application\MyAppAppService.cs:lin
e 75
at lambda_method(Closure , Object )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, O
bject[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope s
cope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope,
Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object
state, Boolean isCompleted)
Correct : )
LicenseChecker.Check
will read AbpLicenseCode
in appsettings.json
to check your license.
The Volo.Abp.Commercial.Core
package is not open source.
hi @truong.nguyen@outlook.com
If you have the source code of the module, you can remove it, the nuget package of abp commercial requires license check.
hi @shobhit
Is your purpose to log in through Microsoft or other social accounts in Angular?
hi
There is no problem with passing the token using the Authorization
request header. Authorization: Bearer token
Authorization failed! Give policy has not grandted
You can check the application's log to see the details.
hi @suraj.kumbhar
Can you share your project to me? include the necessary steps.
I will try to reproduce your problem.
My email: liming.ma@volosoft.com
Thanks.
hi
When IsAbandoned is true, it means that an exception has occurred.
Can you check the logs of your application?