Hi maliming, I dont know why the DocumentService lauchsettings.json point to 44377 but I have changed to 44308
And this is detailed logs after I changed port number
2024-11-07 20:41:17.093 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.js - null null 2024-11-07 20:41:17.108 +07:00 [INF] Sending file. Request path: '/swagger/ui/abp.js'. Physical path: 'N/A' 2024-11-07 20:41:17.109 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.js - 200 3122 application/javascript 16.0826ms 2024-11-07 20:41:17.139 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.swagger.js - null null 2024-11-07 20:41:17.139 +07:00 [INF] Sending file. Request path: '/swagger/ui/abp.swagger.js'. Physical path: 'N/A' 2024-11-07 20:41:17.140 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/ui/abp.swagger.js - 200 4527 application/javascript 1.0109ms 2024-11-07 20:41:17.178 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-bundle.js - null null 2024-11-07 20:41:17.183 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-standalone-preset.js - null null 2024-11-07 20:41:17.183 +07:00 [INF] Sending file. Request path: '/swagger-ui-bundle.js'. Physical path: 'N/A' 2024-11-07 20:41:17.184 +07:00 [INF] Sending file. Request path: '/swagger-ui-standalone-preset.js'. Physical path: 'N/A' 2024-11-07 20:41:17.196 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-standalone-preset.js - 200 312163 text/javascript 12.9733ms 2024-11-07 20:41:17.196 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/swagger-ui-bundle.js - 200 1061536 text/javascript 17.5968ms 2024-11-07 20:41:18.014 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - null null 2024-11-07 20:41:18.031 +07:00 [INF] Executing endpoint 'DocumentsSwagger' 2024-11-07 20:41:18.079 +07:00 [INF] Proxying to http://localhost:44308/swagger/v1/swagger.json HTTP/2 RequestVersionOrLower no-streaming 2024-11-07 20:41:23.013 +07:00 [INF] "Request": An error was encountered before receiving a response. System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (localhost:44308) ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem) at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Yarp.ReverseProxy.Forwarder.HttpForwarder.SendAsync(HttpContext context, String destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer, CancellationToken cancellationToken) 2024-11-07 20:41:23.032 +07:00 [INF] Executed endpoint 'DocumentsSwagger' 2024-11-07 20:41:23.035 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - 502 0 null 5021.3847ms
Hi maliming,
There are the detailed logs:
2024-11-07 15:14:28.369 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger/index.html?urls.primaryName=Documents%20API - null null 2024-11-07 15:14:28.371 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger/index.html?urls.primaryName=Documents%20API - 200 null text/html;charset=utf-8 2.0706ms 2024-11-07 15:14:28.772 +07:00 [INF] Request starting HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - null null 2024-11-07 15:14:28.773 +07:00 [INF] Executing endpoint 'DocumentsSwagger' 2024-11-07 15:14:28.774 +07:00 [INF] Proxying to http://localhost:44308/swagger/v1/swagger.json HTTP/2 RequestVersionOrLower no-streaming 2024-11-07 15:14:32.816 +07:00 [INF] "Request": An error was encountered before receiving a response. System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (localhost:44308) ---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it. at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|285_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(QueueItem queueItem) at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken) at Yarp.ReverseProxy.Forwarder.HttpForwarder.SendAsync(HttpContext context, String destinationPrefix, HttpMessageInvoker httpClient, ForwarderRequestConfig requestConfig, HttpTransformer transformer, CancellationToken cancellationToken) 2024-11-07 15:14:32.816 +07:00 [INF] Executed endpoint 'DocumentsSwagger' 2024-11-07 15:14:32.816 +07:00 [INF] Request finished HTTP/1.1 GET http://localhost:44322/swagger-json/Documents/swagger/v1/swagger.json - 502 0 null 4043.979ms
I have updated the dependencies as you suggested. And still have the same issues.
Please pull code again to check.
Thank you.
hi
Can you share your github url again?
Thanks.
I have shared, please check your email
It works as expect. Thank you so much.
I just sent the invitation, please check your email. Main project is TSD.DOCS.AdminCategoryService in \services\admin\category
If needed, I can share all solutions with you by adding you to my Github repo.
Because I use "Customizable Code" option so I have two files: EfCoreListOrganizationRepository.cs
public class EfCoreListOrganizationRepositoryBase : EfCoreRepository<IAdminCategoryServiceDbContext, ListOrganization, long>
{
public EfCoreListOrganizationRepositoryBase(IDbContextProvider<IAdminCategoryServiceDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public virtual async Task DeleteAllAsync(
string? filterText = null,
long? nodeIdMin = null,
long? nodeIdMax = null,
string? orgName = null,
string? orgShortcut = null,
long? orgNodeIdMin = null,
long? orgNodeIdMax = null,
int? orgOrderMin = null,
int? orgOrderMax = null,
string? orgMap = null,
string? dataOwner = null,
short? statusMin = null,
short? statusMax = null,
string? textSearch = null,
Guid? guidId = null,
string? code = null,
string? emailAddress = null,
string? phoneNumber = null,
string? address = null,
string? cityId = null,
string? districtId = null,
short? portalOrgTypeMin = null,
short? portalOrgTypeMax = null,
short? fromSourceTypeMin = null,
short? fromSourceTypeMax = null,
short? isRegisterPortalMin = null,
short? isRegisterPortalMax = null,
Guid? portalGuidId = null,
CancellationToken cancellationToken = default)
{
var query = await GetQueryableAsync();
query = ApplyFilter(query, filterText, nodeIdMin, nodeIdMax, orgName, orgShortcut, orgNodeIdMin, orgNodeIdMax, orgOrderMin, orgOrderMax, orgMap, dataOwner, statusMin, statusMax, textSearch, guidId, code, emailAddress, phoneNumber, address, cityId, districtId, portalOrgTypeMin, portalOrgTypeMax, fromSourceTypeMin, fromSourceTypeMax, isRegisterPortalMin, isRegisterPortalMax, portalGuidId);
var ids = query.Select(x => x.Id);
await DeleteManyAsync(ids, cancellationToken: GetCancellationToken(cancellationToken));
}
public virtual async Task<List<ListOrganization>> GetListAsync(
string? filterText = null,
long? nodeIdMin = null,
long? nodeIdMax = null,
string? orgName = null,
string? orgShortcut = null,
long? orgNodeIdMin = null,
long? orgNodeIdMax = null,
int? orgOrderMin = null,
int? orgOrderMax = null,
string? orgMap = null,
string? dataOwner = null,
short? statusMin = null,
short? statusMax = null,
string? textSearch = null,
Guid? guidId = null,
string? code = null,
string? emailAddress = null,
string? phoneNumber = null,
string? address = null,
string? cityId = null,
string? districtId = null,
short? portalOrgTypeMin = null,
short? portalOrgTypeMax = null,
short? fromSourceTypeMin = null,
short? fromSourceTypeMax = null,
short? isRegisterPortalMin = null,
short? isRegisterPortalMax = null,
Guid? portalGuidId = null,
string? sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
CancellationToken cancellationToken = default)
{
var query = ApplyFilter((await GetQueryableAsync()), filterText, nodeIdMin, nodeIdMax, orgName, orgShortcut, orgNodeIdMin, orgNodeIdMax, orgOrderMin, orgOrderMax, orgMap, dataOwner, statusMin, statusMax, textSearch, guidId, code, emailAddress, phoneNumber, address, cityId, districtId, portalOrgTypeMin, portalOrgTypeMax, fromSourceTypeMin, fromSourceTypeMax, isRegisterPortalMin, isRegisterPortalMax, portalGuidId);
query = query.OrderBy(string.IsNullOrWhiteSpace(sorting) ? ListOrganizationConsts.GetDefaultSorting(false) : sorting);
return await query.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken);
}
public virtual async Task<long> GetCountAsync(
string? filterText = null,
long? nodeIdMin = null,
long? nodeIdMax = null,
string? orgName = null,
string? orgShortcut = null,
long? orgNodeIdMin = null,
long? orgNodeIdMax = null,
int? orgOrderMin = null,
int? orgOrderMax = null,
string? orgMap = null,
string? dataOwner = null,
short? statusMin = null,
short? statusMax = null,
string? textSearch = null,
Guid? guidId = null,
string? code = null,
string? emailAddress = null,
string? phoneNumber = null,
string? address = null,
string? cityId = null,
string? districtId = null,
short? portalOrgTypeMin = null,
short? portalOrgTypeMax = null,
short? fromSourceTypeMin = null,
short? fromSourceTypeMax = null,
short? isRegisterPortalMin = null,
short? isRegisterPortalMax = null,
Guid? portalGuidId = null,
CancellationToken cancellationToken = default)
{
var query = ApplyFilter((await GetDbSetAsync()), filterText, nodeIdMin, nodeIdMax, orgName, orgShortcut, orgNodeIdMin, orgNodeIdMax, orgOrderMin, orgOrderMax, orgMap, dataOwner, statusMin, statusMax, textSearch, guidId, code, emailAddress, phoneNumber, address, cityId, districtId, portalOrgTypeMin, portalOrgTypeMax, fromSourceTypeMin, fromSourceTypeMax, isRegisterPortalMin, isRegisterPortalMax, portalGuidId);
return await query.LongCountAsync(GetCancellationToken(cancellationToken));
}
protected virtual IQueryable<ListOrganization> ApplyFilter(
IQueryable<ListOrganization> query,
string? filterText = null,
long? nodeIdMin = null,
long? nodeIdMax = null,
string? orgName = null,
string? orgShortcut = null,
long? orgNodeIdMin = null,
long? orgNodeIdMax = null,
int? orgOrderMin = null,
int? orgOrderMax = null,
string? orgMap = null,
string? dataOwner = null,
short? statusMin = null,
short? statusMax = null,
string? textSearch = null,
Guid? guidId = null,
string? code = null,
string? emailAddress = null,
string? phoneNumber = null,
string? address = null,
string? cityId = null,
string? districtId = null,
short? portalOrgTypeMin = null,
short? portalOrgTypeMax = null,
short? fromSourceTypeMin = null,
short? fromSourceTypeMax = null,
short? isRegisterPortalMin = null,
short? isRegisterPortalMax = null,
Guid? portalGuidId = null)
{
return query
.WhereIf(!string.IsNullOrWhiteSpace(filterText), e => e.OrgName!.Contains(filterText!) || e.OrgShortcut!.Contains(filterText!) || e.OrgMap!.Contains(filterText!) || e.DataOwner!.Contains(filterText!) || e.TextSearch!.Contains(filterText!) || e.Code!.Contains(filterText!) || e.EmailAddress!.Contains(filterText!) || e.PhoneNumber!.Contains(filterText!) || e.Address!.Contains(filterText!) || e.CityId!.Contains(filterText!) || e.DistrictId!.Contains(filterText!))
.WhereIf(nodeIdMin.HasValue, e => e.NodeId >= nodeIdMin!.Value)
.WhereIf(nodeIdMax.HasValue, e => e.NodeId <= nodeIdMax!.Value)
.WhereIf(!string.IsNullOrWhiteSpace(orgName), e => e.OrgName.Contains(orgName))
.WhereIf(!string.IsNullOrWhiteSpace(orgShortcut), e => e.OrgShortcut.Contains(orgShortcut))
.WhereIf(orgNodeIdMin.HasValue, e => e.OrgNodeId >= orgNodeIdMin!.Value)
.WhereIf(orgNodeIdMax.HasValue, e => e.OrgNodeId <= orgNodeIdMax!.Value)
.WhereIf(orgOrderMin.HasValue, e => e.OrgOrder >= orgOrderMin!.Value)
.WhereIf(orgOrderMax.HasValue, e => e.OrgOrder <= orgOrderMax!.Value)
.WhereIf(!string.IsNullOrWhiteSpace(orgMap), e => e.OrgMap.Contains(orgMap))
.WhereIf(!string.IsNullOrWhiteSpace(dataOwner), e => e.DataOwner.Contains(dataOwner))
.WhereIf(statusMin.HasValue, e => e.Status >= statusMin!.Value)
.WhereIf(statusMax.HasValue, e => e.Status <= statusMax!.Value)
.WhereIf(!string.IsNullOrWhiteSpace(textSearch), e => e.TextSearch.Contains(textSearch))
.WhereIf(guidId.HasValue, e => e.GuidId == guidId)
.WhereIf(!string.IsNullOrWhiteSpace(code), e => e.Code.Contains(code))
.WhereIf(!string.IsNullOrWhiteSpace(emailAddress), e => e.EmailAddress.Contains(emailAddress))
.WhereIf(!string.IsNullOrWhiteSpace(phoneNumber), e => e.PhoneNumber.Contains(phoneNumber))
.WhereIf(!string.IsNullOrWhiteSpace(address), e => e.Address.Contains(address))
.WhereIf(!string.IsNullOrWhiteSpace(cityId), e => e.CityId.Contains(cityId))
.WhereIf(!string.IsNullOrWhiteSpace(districtId), e => e.DistrictId.Contains(districtId))
.WhereIf(portalOrgTypeMin.HasValue, e => e.PortalOrgType >= portalOrgTypeMin!.Value)
.WhereIf(portalOrgTypeMax.HasValue, e => e.PortalOrgType <= portalOrgTypeMax!.Value)
.WhereIf(fromSourceTypeMin.HasValue, e => e.FromSourceType >= fromSourceTypeMin!.Value)
.WhereIf(fromSourceTypeMax.HasValue, e => e.FromSourceType <= fromSourceTypeMax!.Value)
.WhereIf(isRegisterPortalMin.HasValue, e => e.IsRegisterPortal >= isRegisterPortalMin!.Value)
.WhereIf(isRegisterPortalMax.HasValue, e => e.IsRegisterPortal <= isRegisterPortalMax!.Value)
.WhereIf(portalGuidId.HasValue, e => e.PortalGuidId == portalGuidId);
}
}
EfCoreListOrganizationRepository.Extended.cs
public class EfCoreListOrganizationRepository : EfCoreListOrganizationRepositoryBase, IListOrganizationRepository
{
public EfCoreListOrganizationRepository(IDbContextProvider<IAdminCategoryServiceDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
}