Morning,
I have a bit of an issue which I cannot seem to resolve by myself. I am using the Core+Angular template.
Firstly, I have created a number of AppServices in a separate module (i.e. not in the standard MyProject*.Application project). These are all working fine when using the Swagger UI and Postman.
Then I ran nswag/refresh.bat and referred to the generated ProxyServices as providers in service-proxymodule.ts
I have then created a couple of Components.
When I open the page in a browser I get 401 (Unauthorized). This is because the server is complaining the user hasn't been logged in.
Using Fiddler I notice that my component does not include any auth header tokens.
Below is some sample code from my component:
import { Component, Injector, ViewEncapsulation, OnInit } from '@angular/core';
import { appModuleAnimation } from '@shared/animations/routerTransition';
import { AppComponentBase } from '@shared/common/app-component-base';
import { PatientsServiceProxy, CreateOrEditPatientDto, GetPatientForEditOutput} from '@shared/service-proxies/service-proxies';
declare let d3, Datamap: any;
@Component({
templateUrl: './patient-details.component.html',
encapsulation: ViewEncapsulation.None,
animations: [appModuleAnimation()]
})
export class PatientDetailsComponent extends AppComponentBase implements OnInit {
ngOnInit(): void {
}
constructor(
injector: Injector,
private _patientsServiceProxy: PatientsServiceProxy
) {
super(injector);
}
active: boolean = false;
saving: boolean = false;
patientId: string;
patient: CreateOrEditPatientDto = new CreateOrEditPatientDto();
savePatient(): void {
this.saving = true;
this._patientsServiceProxy.createOrEdit(this.patient)
.finally(() => { this.saving = false; })
.subscribe(() => {
this.notify.info(this.l('SavedSuccessfully'));
});
}
}
How do I get my component to include the auth? I thought that proxy services would solve that...
I have updated to 5.4.1 a couple of days ago. When I try to run code generated by the RAD Tool I get the following error:
ERROR in ./node_modules/abp-ng2-module/src/notify/notify.service.ts Module build failed: Error: C:\Repos\Danely\angular\node_modules\abp-ng2-module\src\notify\notify.service.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (<a class="postlink" href="https://goo.gl/jB3GVv">https://goo.gl/jB3GVv</a>). at AngularCompilerPlugin.getCompiledFile (C:\Repos\Danely\angular\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:709:23) at plugin.done.then (C:\Repos\Danely\angular\node_modules@ngtools\webpack\src\loader.js:41:31) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
I should also mention that since the upgrade it takes forever to complete sourcemap (it is stuck at 92%) since the upgrade.
Have you seen this before? Do you know why this would be?
Hi,
When I create a new XXXAppService class and inherit from the initial MyProjectAppServiceBase and IApplicationService everything works fine - - IF the class is located in the MyProject.Application project, but not if I create it in MyNewProject. Why is that?
I am guessing this has to do with the way DI has been implemented. Is there a way to force DI to identify AppServices in other projects?
Hi,
I am running Angular with Asp.Net Core (two services - not merged) and would like to enable application insights (AI) for the Asp.Net Core Host service running in Azure. I have been able to connect the AI Log4Net appender and it is sending trace logs to AI. However, it is not collecting anything else.
Is it possible to run AI this way?
Thor
Hi,
Have downloaded and installed MVC5 and Angular. Everything is working fine locally.
The system is deployed to Azure.
I get "An error has occurred! - Error detail not sent by server." when I log in to the angular app. The username in the top right corner is showing {{vm.getShownUserName()}}. All appears to be working fine using a mobile instead of a desktop browser.
The error message in app_data/logs is showing:
DEBUG 2018-01-01 03:59:44,447 [13 ] Abp.Auditing.WebClientInfoProvider - System.Net.Sockets.SocketException (0x80004005): No such host is known at System.Net.Dns.GetAddrInfo(String name) at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at Abp.Auditing.WebClientInfoProvider.GetClientIpAddress() in D:\Github\aspnetboilerplate\src\Abp.Web\Auditing\WebClientInfoProvider.cs:line 53
"Help me Obi Wan..." ;)