Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "kythor"

and now after changing nothing but restarting IIS, i get the loading screen and after a while the message "an error has occured". In the F12 network screen there is even nothing, no GetAll or anything...

it gets weirder and weirder.

but the public mvc site loads without a problem... so is this an angular issue?

however it does kind of work if I add the tenant url to my IIS (host name) bindings. but i guess that beats the purpose of auto tenant creation?

and If I login successfully, I get an error on the Angular app, but not on the public mvc site...

doesnt work:

Accept:/ Accept-Encoding:gzip, deflate Accept-Language:nl-NL,nl;q=0.8,en-US;q=0.6,en;q=0.4 Access-Control-Request-Headers:.aspnetcore.culture,abp.tenantid,authorization,content-type,x-requested-with Access-Control-Request-Method:GET Connection:keep-alive Host:lanista..eu: Origin:http://lanista..eu Referer:http://lanista..eu/ User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Hostname</h2>
<hr><p>HTTP Error 400. The request hostname is invalid.</p>
</BODY></HTML>

Angular appconfig.json:

{
  "remoteServiceBaseUrl": "http://{TENANCY_NAME}.mydomain.eu:8080",
  "appBaseUrl": "http://{TENANCY_NAME}.mydomain.eu"
}

Host appconfig.json:

{
  "ConnectionStrings": {
    "Default": "Data Source=**;Initial Catalog=**;Persist Security Info=True;User ID=**;Password=**;MultipleActiveResultSets=True"
  },

  "Abp": {
    "RedisCache": {
      "ConnectionString": "localhost",
      "DatabaseId": -1
    }
  },

  "App": {
    "ServerRootAddress": "http://www.mydomain.eu:8080",
    "ClientRootAddress": "http://www.mydomain.eu",
    "CorsOrigins": "http://www.mydomain.eu,http://www.mydomain.eu:8080"
  },

  "Authentication": {
    "Facebook": {
      "IsEnabled": "false",
      "AppId": "",
      "AppSecret": ""
    },
    "Google": {
      "IsEnabled": "false",
      "ClientId": "",
      "ClientSecret": ""
    },
    "Microsoft": {
      "IsEnabled": "false",
      "ConsumerKey": "",
      "ConsumerSecret": ""
    },
    "JwtBearer": {
      "IsEnabled": "true",
      "SecurityKey": "**",
      "Issuer": "OPTA",
      "Audience": "OPTA"
    }
  },

  "Recaptcha": {
    "SiteKey": "**-**-",
    "SecretKey": "**-**"
  },

  "IdentityServer": {
    "IsEnabled": "true",
    "Clients": [
      {
        "ClientId": "client",
        "AllowedGrantTypes": [ "password" ],
        "ClientSecrets": [
          {
            "Value": "**"
          }
        ],
        "AllowedScopes": [ "default-api" ]
      },
      {
        "ClientId": "demo",
        "ClientName": "MVC Client Demo",
        "AllowedGrantTypes": [ "hybrid", "client_credentials" ],
        "RequireConsent": "true",
        "ClientSecrets": [
          {
            "Value": "**"
          }
        ],
        "RedirectUris": [ "http://openidclientdemo.com:8001/signin-oidc" ],
        "PostLogoutRedirectUris": [ "http://openidclientdemo.com:8001/signout-callback-oidc" ],
        "AllowedScopes": [ "openid", "profile", "default-api" ],
        "AllowOfflineAccess": "true"
      }
    ]
  },

  "Payment": {
    "PayPal": {
      "Environment": "sandbox",
      "BaseUrl": "https://api.sandbox.paypal.com/v1",
      "ClientId": "",
      "ClientSecret": "",
      "DemoUsername": "",
      "DemoPassword": ""
    }
  }
}

now however, when I added a tenant and try to go to the tenant url (eg <a class="postlink" href="http://tenant.domain.com">http://tenant.domain.com</a>) i get an error stating "CORS-header ‘Access-Control-Allow-Origin’ missing

its looking for <a class="postlink" href="http://tenant.domain.com:8080/AbpUserConfiguration/GetAll">http://tenant.domain.com:8080/AbpUserCo ... ion/GetAll</a>

since my RemoteServiceBaseUrl points to http://{tenancy_name}.domain.com:8080

adding <a class="postlink" href="http://tenant.domain.com">http://tenant.domain.com</a> into CorsOrigins field of the host appsettings.json does not fix it

found this post: #4018@5c502c01-b478-4bea-b9c7-320840d7c879

its part of the solution, since my appconfig.json on the host application was not correct, need to add client and host url to "CorsOrigins"

errors again, this is frustrating, because I have not yet changed a line of code...

i get a connection time out error now from just loading the site: :8080/AbpUserConfiguration/GetAll net::ERR_CONNECTION_TIMED_OUT

yes I'm using this web.config. But now it works again...

I'm new with Angular, so excuse my limited knowledge.

Answer

I got it to work, thanks for your help!

Answer

back trying to get logging to work. This is what I have:

//Log4Net configuration
            AbpBootstrapper.IocManager.IocContainer
                .AddFacility<LoggingFacility>(f => f.UseLog4Net()
                    .WithConfig("log4net.config")
                );

and log4net.config is:

<?xml version="1.0" encoding="utf-8" ?>
<log4net>
  <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender" >
    <file value="App_Data/Logs/Logs.txt" />
    <encoding value="utf-8" />
    <appendToFile value="true" />
    <rollingStyle value="Size" />
    <maxSizeRollBackups value="10" />
    <maximumFileSize value="10000KB" />
    <staticLogFileName value="true" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%-5level %date [%-5.5thread] %-40.40logger - %message%newline" />
    </layout>
  </appender>
  <root>
    <appender-ref ref="RollingFileAppender" />
    <level value="DEBUG" />
  </root>
</log4net>

I can add logging in the code like this:

Logger.Info("test ");

without it throwing errors, but no Log.txt is generated.

if it wouldnt have rights to write the file, should it throw errors?

Showing 51 to 60 of 129 entries