I know the abp vnext has a very good modular structure l.
i want to develop a modules which will basiclly be a course catalong with video tutorials within each course. the videos will be on vimeo.
can somone point me to how I can develop a module for aspnetzero?
When I deployed AspNetCore & Angular to Azure the Chat won't connect and throughs websocket errors
I have just deployed the AspNetCore & Angular App Version 7.1.0 to Azure and I am getting the following error
Access to XMLHttpRequest at 'https://amazingsolutions-server.azurewebsites.net/AbpUserConfiguration/GetAll?d=1567147694729' from origin 'https://amazingsolutions-client.azurewebsites.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
can you please help?
appsetting.production.json
{ "ConnectionStrings": { "Default": "Server=tcp:{DB Name};Initial Catalog={Database Name};Persist Security Info=False;User ID={User Name};Password={Password}!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" }, "App": { "ServerRootAddress": "https://amazingsolutions-server.azurewebsites.net", "ClientRootAddress": "https://amazingsolutions-client.azurewebsites.net", "CorsOrigins": "https://amazingsolutions-client.azurewebsites.net, https://*.amazingsolutions.com.au" } }
appconfig.production.json
{ "remoteServiceBaseUrl": "https://amazingsolutions-server.azurewebsites.net", "appBaseUrl": "https://amazingsolutions-client.azurewebsites.net", "localeMappings": { "angular": [ { "from": "pt-BR", "to": "pt" }, { "from": "zh-CN", "to": "zh" }, { "from": "he-IL", "to": "he" }, { "from": "es-MX", "to": "es" }, { "from": "vi", "to": "en" } ], "moment": [ { "from": "es-MX", "to": "es" }, { "from": "zh-Hans", "to": "zh-cn" }, { "from": "vi", "to": "en-gb" } ] } }
amazingsolitions-client.azurewebsites.net/:1 Access to XMLHttpRequest at 'https://amazingsolutions.azurewebsites.net/AbpUserConfiguration/GetAll?d=1557379133284' from origin 'http://amazingsolitions-client.azurewebsites.net' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Getting the following error when i run ng build --prod
chunk {1087} 1087.d0660c70a921ec2d081d.js () 2.41 kB [rendered] chunk {1088} 1088.81d657baee0203f2e23c.js () 1.24 kB [rendered] chunk {1089} 1089.e22e0e6466296922a63b.js () 3.15 kB [rendered] chunk {1090} 1090.35cf5f1ff3979025db82.js () 1.54 kB [rendered] chunk {1091} 1091.6234fa9298e4fcca6db6.js () 2.19 kB [rendered] chunk {scripts} scripts.64884b7aff66d8483343.js (scripts) 1.64 MB [entry] [rendered]
WARNING in ./node_modules/@swimlane/ngx-charts/release/common/base-chart.component.js 20:38-56 "export 'VisibilityObserver' was not found in '../utils'
ERROR in ./node_modules/object-path/index.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): Error: ENOENT: no such file or directory, open 'C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\object-path\index.js' at Object.openSync (fs.js:438:3) at Object.readFileSync (fs.js:343:35) at Storage.provideSync (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:98:13) at CachedInputFileSystem.readFileSync (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:259:32) at Observable.rxjs_1.Observable.obs [as _subscribe] (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\src\webpack-input-host.js:35:51) at Observable._trySubscribe (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\node_modules\rxjs\internal\Observable.js:44:25) at Observable.subscribe (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\node_modules\rxjs\internal\Observable.js:30:22) at SyncDelegateHost._doSyncCall (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@angular-devkit\core\src\virtual-fs\host\sync.js:22:20) at SyncDelegateHost.read (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@angular-devkit\core\src\virtual-fs\host\sync.js:49:21) at WebpackCompilerHost.readFileBuffer (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\src\compiler_host.js:125:44) at VirtualFileSystemDecorator.readFile (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\src\virtual_file_system_decorator.js:39:54) at processResource (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:202:11) at iteratePitchingLoaders (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:158:10) at iteratePitchingLoaders (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:165:10) at C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:176:18 at loadLoader (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\loadLoader.js:47:3) ERROR in ./node_modules/rtl-detect/index.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): Error: ENOENT: no such file or directory, open 'C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\rtl-detect\index.js' at Object.openSync (fs.js:438:3) at Object.readFileSync (fs.js:343:35) at Storage.provideSync (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:98:13) at CachedInputFileSystem.readFileSync (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:259:32) at Observable.rxjs_1.Observable.obs [as _subscribe] (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\src\webpack-input-host.js:35:51) at Observable._trySubscribe (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\node_modules\rxjs\internal\Observable.js:44:25) at Observable.subscribe (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\node_modules\rxjs\internal\Observable.js:30:22) at SyncDelegateHost._doSyncCall (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@angular-devkit\core\src\virtual-fs\host\sync.js:22:20) at SyncDelegateHost.read (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@angular-devkit\core\src\virtual-fs\host\sync.js:49:21) at WebpackCompilerHost.readFileBuffer (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\src\compiler_host.js:125:44) at VirtualFileSystemDecorator.readFile (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules@ngtools\webpack\src\virtual_file_system_decorator.js:39:54) at processResource (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:202:11) at iteratePitchingLoaders (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:158:10) at iteratePitchingLoaders (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:165:10) at C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\LoaderRunner.js:176:18 at loadLoader (C:\Users\vbelani\Amazing\AmazingSoftware\angular\node_modules\loader-runner\lib\loadLoader.js:47:3)
i am wonderjngbis there is a way to strat the HOST, PIBLIC SITE and the corr project all by pressing the play button in VS 2017?
i dont want to each and every time open cmd prompt and run the "Start npm" command?
Hi, I would like to cache-control the different contenttype like image/jpeg. currently, i have written application server method which is always conveted into dynamic web api with contenttype application/JSON.
I would like to achieve the cache-control mechanism for some of the images i am returnig to client using below application service method. but when i try calling web api method from swagger dynamic web api interface, it is always content type of application/json with no-cache control.
my application service method is as below
public HttpResponseMessage GetContractSignatures()
{
HttpResponseMessage response = new HttpResponseMessage(System.Net.HttpStatusCode.OK);
try
{
byte[] buffer = _attachmentImagesRepository.Get(1).Image;
//var image = Image.FromStream(new MemoryStream(buffer));
Image image = Image.FromStream(new MemoryStream(buffer));
MemoryStream memoryStream = new MemoryStream();
image.Save(memoryStream, ImageFormat.Jpeg);
response.Content = new ByteArrayContent(memoryStream.ToArray());
response.Content.Headers.ContentType = new MediaTypeHeaderValue("image/jpeg");
response.Headers.CacheControl = new CacheControlHeaderValue() { Public = true, MaxAge = new TimeSpan(1, 0, 0, 0) };
return response;
}
catch (HttpException)
{
response.Content = new StringContent("HttpException", Encoding.UTF8, "image/jpeg");
return response;
}
}
I am getting a very strange error. My solution was working correctly.
This is the method signature of my personAppService.
public PersonAppService : AppConnectAppServiceBase, IPersonAppService { public async Task CreateOrUpdateApplicant(OppPersonInput input, string opportunityId); }
I call this method from within another service like so,
await _personAppService.CreateOrUpdateApplicant(input.Applicant, input.OpportunityId);
My input objects looks like this public class input { public string OpportunityId { get; set; } public OppPersonInput Applicant { get; set; } }
[AutoMap(typeof(Person))] public class OppPersonInput { [MaxLength(40)] public string LastName { get; set; } [MaxLength(40)] public string FirstName { get; set; } }
Person is an entity framework entity.
When input.Applicant is passed as null from the DTO, the CreateOrUpdateApplicant throws a validation exception ( the control does not even pass into the function). I have also tried passing null directly into this function but that doesnt work either. OppPersonInput has not been set to [Required] and none of its properties are Required.
I have made sure that I am passing {Applicant : null} in the input object DTO through swagger. But even if I pass a null value to the function directly as in _personAppService.CreateOrUpdateApplicant(null, input.OpportunityId) I get the validation messages below (in C# obviously you can pass null to a function).
'Abp.Runtime.Validation.Abp ValidationException' in Abp.dll ("Method arguments are not valid! See Validation Errors for details.")
See ValidationErrors for details. at Abp.Runtime.Validation.Interception.MethodInvocationValidator.Validate() in D:\Halil\Github\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\MethodInvocationValidator.cs:line 94 at Abp.Runtime.Validation.Interception.ValidationInterceptor.Intercept(IInvocation invocation) in D:\Halil\Github\aspnetboilerplate\src\Abp\Runtime\Validation\Interception\ValidationInterceptor.cs:line 31 at Castle.DynamicProxy.AbstractInvocation.Proceed()
Hi.
Just needed to call a stored procedure from within the AppService. I had a look at this page,
#3001@1ae4525e-277b-4e15-9771-14ec911be476
but it still isn't very clear as to how to implement this. Your help would be much appreciated.
Thinking of doing something on these lines
public async System.Threading.Tasks.Task<System.Collections.Generic.List<int>> CallStoreProc()
{
return await Context.Database.SqlQuery<int>("get_id_of_customer").SingleAsync();
}
Regards