Base solution for your next web application

Activities of "btg"

Answer

New Problem ... CORS is blocked despite the following settings.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://myurl:22742/AbpUserConfiguration/GetAll. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Angular appconfig.json

{
  "remoteServiceBaseUrl": "http://myurl:22742",
  "appBaseUrl": "http://myurl:4200"
}

Web.Host Project

"App": {
    "ServerRootAddress": "http://myurl:22742",
    "ClientRootAddress": "http://myurl:4200",
    "CorsOrigins": "http://myurl:4200,http://myurl,http://localhost:49152,http://localhost:8182"
  },

Any ideas? I've been playing all day with this and I can't get it to work.

Answer

It is an IIS issue ... solved by directly running the EXE. I will work through it. Thanks.

Answer

.NET CORE 2.0 Hosting is installed, IIS Application Pool is unmanaged code, ports are bound to 80 and 22472. I will play around with the environment more, but I don't think this is the issue.

Are there any issues with running x86 vs x64?

Answer

It also happens on default IPs, like 22742 for Swagger.

Closer, but the button doesn't work and I get the following error. Am I passing a parameter incorrectly, or not doing something right with the Dto?

core.es5.js:1084 ERROR TypeError: Cannot read property 'open' of undefined

.

This is what I have now:

ngOnInit(): void {
        this.getLake();

        var dataSource = this.loadData(dataSource);
        this.loadView(dataSource);

       
    

 getLake(): void {
        this._dataService.getLake(this.filter).subscribe((result) => {
            this.Lake = result.items;
        });
    }

    loadData(data: DataListDto): string {
        var dataid = "foo";
        var data = dataid.toString();
        var dataext = ".jpg";
        var url = "http://localhost:4000/;

        var dataSource = url.concat(data, dataext);
    
        return dataSource;
    }

    loaddataModal(data: DataListDto) {
        var dataSource = this.loadData(dataSource);
        var url = this.loadData(url);
        var data = this.loadData(data);
        var dataext = this.loadData(dataext);
        var view = this.loadView(view);

        this.message.confirm(
            this.l('ReadyToView', "data.name"),
            isConfirmed => {
                if (isConfirmed) {
                    this.notify.info(this.l('SuccessfullyLoaded'));
                    dataSource = url.concat(data, dataext);
                    view.open(dataSource)
                }
            }
        );
    }

    loadViewer(dataSource: string): void {

        var view = new Viewer({
            ...
        });
       
        });
    }

Thank you. I had forgotten to add public to it. :roll:

<cite>btg: </cite> Aaah, I knew it was something I had overlooked. That fixed the display issue, but now I get an error that the resource cannot be found. Any thoughts on this, or should I open a new topic?

I should be more specific. It seems as though my AJAX request is not able to find the file (easily fixable), but it the bigger issue is the information in the JSON is not accessible I guess. Do I need to run everything through the database, even if I just want to use a standable JSON from a feed??

The error in console is:

platform-content.js:682 post-publish handshake listeners already initialized
jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 3.0.0
2zone.js:2176 OPTIONS http://localhost:8080/assets/json/data.json 405 (Method Not Allowed)
scheduleTask @ zone.js:2176
ZoneDelegate.scheduleTask @ zone.js:384
onScheduleTask @ zone.js:274
ZoneDelegate.scheduleTask @ zone.js:378
Zone.scheduleTask @ zone.js:209
Zone.scheduleMacroTask @ zone.js:232
(anonymous) @ zone.js:2200
send @ VM10989:3
(anonymous) @ http.es5.js:1254
Observable._trySubscribe @ Observable.js:57
Observable.subscribe @ Observable.js:45
MapOperator.call @ map.js:54
Observable.subscribe @ Observable.js:42
CatchOperator.call @ catch.js:79
Observable.subscribe @ Observable.js:42
MapOperator.call @ map.js:54
Observable.subscribe @ Observable.js:42
CatchOperator.call @ catch.js:79
Observable.subscribe @ Observable.js:42
webpackJsonp.1241.InfoComponent.ngAfterViewInit @ info-json.component.ts:28
callProviderLifecycles @ core.es5.js:11045
callElementProvidersLifecycles @ core.es5.js:11020
callLifecycleHooksChildrenFirst @ core.es5.js:11004
checkAndUpdateView @ core.es5.js:12026
callViewAction @ core.es5.js:12333
execComponentViewsAction @ core.es5.js:12279
checkAndUpdateView @ core.es5.js:12024
callViewAction @ core.es5.js:12333
execEmbeddedViewsAction @ core.es5.js:12305
checkAndUpdateView @ core.es5.js:12019
callViewAction @ core.es5.js:12333
execComponentViewsAction @ core.es5.js:12279
checkAndUpdateView @ core.es5.js:12024
callViewAction @ core.es5.js:12333
execEmbeddedViewsAction @ core.es5.js:12305
checkAndUpdateView @ core.es5.js:12019
callViewAction @ core.es5.js:12333
execComponentViewsAction @ core.es5.js:12279
checkAndUpdateView @ core.es5.js:12024
callWithDebugContext @ core.es5.js:13006
debugCheckAndUpdateView @ core.es5.js:12546
ViewRef_.detectChanges @ core.es5.js:10115
(anonymous) @ core.es5.js:5052
ApplicationRef_.tick @ core.es5.js:5052
(anonymous) @ core.es5.js:4932
ZoneDelegate.invoke @ zone.js:365
onInvoke @ core.es5.js:4125
ZoneDelegate.invoke @ zone.js:364
Zone.run @ zone.js:125
NgZone.run @ core.es5.js:3994
next @ core.es5.js:4932
schedulerFn @ core.es5.js:3828
SafeSubscriber.__tryOrUnsub @ Subscriber.js:236
SafeSubscriber.next @ Subscriber.js:185
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ core.es5.js:3814
NgZone.checkStable @ core.es5.js:4090
NgZone.setHasMicrotask @ core.es5.js:4174
onHasTask @ core.es5.js:4137
ZoneDelegate.hasTask @ zone.js:418
ZoneDelegate._updateTaskCount @ zone.js:438
Zone._updateTaskCount @ zone.js:262
Zone.runTask @ zone.js:182
drainMicroTaskQueue @ zone.js:591
ZoneTask.invoke @ zone.js:464
dashboard:1 XMLHttpRequest cannot load http://localhost:8080/assets/json/data.json. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 405.

Aaah, I knew it was something I had overlooked. That fixed the display issue, but now I get an error that the resource cannot be found. Any thoughts on this, or should I open a new topic?

<cite>alirizaadiyahsi: </cite> Hi,

Is there error message anywhere? Can you provide us if there is an error message in your browser dev-console?

No errors at all in the console. NG Live Development server compiles successfully. The HTML component doesn't show on the dashboard though.

Yes, I did add it to the .angular-cli-json. It was missing a letter in the line entry ... so it was a dumb typo.

Thanks for all your guys' help. Feeling dumb right now :(

Showing 1 to 10 of 12 entries