Base solution for your next web application

Activities of "buddhit"

Hi, We are using ASP.NET Zero along with Angular and we are having issues with building an app for production.

Everything is working fine in development, but when we build app for production errors occur. We think that theme profile is not being set as baseSettings variable is undefined and as a consequence app is not rendering.

Hope you can assist. Thank you, buildIssue.PNG

I am assuming that ASP.NET Zero upgrade was not done properly on our side? And this is related to #6285?

Hi there

We have two sperate apps one uses ASPNETZERO 5.5 and another one use 5.6.2. on the 5.5 we have have EntityFrameworkExtension class with WithSqlParam but on the 5.6.2 we cant find have EntityFrameworkExtension class.

 public async Task<int> DeleteDormantRecord(long ppmId)
        {
            EnsureConnectionOpen();
            const string sql = @"delete from Dormantrecords where ppmId = @id";

            using (var command = CreateCommand(sql, _transactionProvider, CommandType.Text))
            {
                var com = command.WithSqlParam("id", ppmId);

                return await com.ExecuteNonQueryAsync();
            }
        }

This is how we used WithSqlParam from extension class on the V5.5.

Hi there,

I know that bit, but priviously we used to have EntityFrameworkExtension class with WithSqlParam method that used to inject params for the query. My question is : Is there any reason that extension is removed ??

Regards Buddhi

Hi there

We have got new version of AspNetZero that is no longer has EntityFrameworkExtension on EntityFrameworkCore. Is there any reason this has been removed. What is alternet way to query raw sql ??

Regards Buddhi

Answer

That fixed the issue, thanks.

Question

Hi there

We are using RAD tool for our new app but when I use lookup table more than one app service (with different name space) we got this error when we run refresh.bat file to generate proxy service for front end.

Conflicting schemaIds: Identical schemaIds detected for types Abp.Application.Services.Dto.PagedResultDto1[[OpuzLite.OpuzTasks.Dtos.BuildingLookupTableDto, OpuzLite.Application.Shared, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null]] and Abp.Application.Services.Dto.PagedResultDto1[OpuzLite.Facilities.Dtos.BuildingLookupTableDto]. See config settings - "CustomSchemaIds" for a workaround

I knew the problem is it generate same lookupTableDto in more than one place. How can we resolve this issue.

Regards Buddhi

Yes, you are right. All 3 sites are writing into the same log file as it is Multi tenancy appp. How do we solve this issue then ??

Hi there

I have tried giving permission to Application pool user as well but no luck. I have three sites on IIS and they are pointed to one application folder. Host app now logging logs into App_data/Logs/logs.txt but still, two other app is not able to write logs. can you suggest something, please?

Regards

Hi there

I got the same issue deploying on IIS, I can't seem to find App_data folder at all. I have tried changing security for IIS user but no luck :(

Regards Buddhi

Hello, were having great difficulty getting the parameters to be successfully bound after submitting a post from the HttpClient in our project.

Our interceptor to handle the cookies and auth,

@Injectable()
export class AuthConn implements HttpInterceptor {

    private _cookieService;

    constructor(private cookieService: CookieService) {
        this._cookieService = cookieService;
    }

    intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {

        if (this._cookieService.check('Abp.AuthToken')) {

            // We have our auth token..
            let bearerToken = this._cookieService.get('Abp.AuthToken');
            // Clone the request to add the new header.
            const authReq = req.clone({headers: req.headers.set('Authorization', 'bearer ' + bearerToken).set('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')});
            // Pass on the cloned request instead of the original request.
            return next.handle(authReq);

        } else {
            // @todo This should sign the user out of the application...
            console.log('here');
        }

    }
}

Our endpoint request:

console.log(gridSettingsObject);

        // Finally go and update the server with our new item.
        this.http.post('http://localhost:22742/api/services/app/UserGridSetting/SaveUserGridSettings', {'jsonData': JSON.stringify(gridSettingsObject)}).subscribe((d: any) => {
            console.log(d);
        });

And finally our C# endpoint:

public async Task<int> SaveUserGridSettings(string jsonData)
        {
            var userId = AbpSession.GetUserId();
            var setting = await _repository.FirstOrDefaultAsync(s => s.UgsUserId == userId);

            if (setting == null)
            {
                setting = new UserGridSettingModel();
            }

            setting.UgsColSetting = jsonData;
            setting.UgsUserId = userId;
            setting.CreatorUserId = userId;
            setting.DeleterUserId = 0;

            return await _repository.InsertOrUpdateAndGetIdAsync(setting);

        }

jsonData just simply never makes it into the parameters but the endpoint is reachable. Whats even stranger is that when doing x-www-form-encoding or multipart in postman the parameter is found. Though changing the content type within our interceptor did not provide the same results so we are stuck..

Showing 1 to 10 of 15 entries