Base solution for your next web application

Activities of "terry21"

We also wish to migrate but the link you mention comes up with a 404 Not found

I am running Abp.AspNetCore 4.3.0. This is happening on the server-side before even starting the angular app. It looks like any Connection string that I add to the main calling Web.Host appsetting.json file overrides my "Default" connection string.

In Web.Host\Startup\Startup.cs Configure method:

            app.UseStaticFiles();

            using (var scope = app.ApplicationServices.CreateScope())
            {
                if (scope.ServiceProvider.GetService<DatabaseCheckHelper>().Exist(_appConfiguration["ConnectionStrings:Default"]))
                {
                    app.UseAbpRequestLocalization();
                }
            }

the_ appConfiguration["ConnectionStrings:Default"]__ value is correct - it points to my Abp database but the connection string used in the app.UseAbpRequestLocalization(); is using the non-Abp connection string as it is connecting to my non-Abp database and so cannot find AbpLanguages (see this using SQL Server Profiler)

I debugged the DatabaseCheckHelper method and when I have the Pludin dlls in the Plugin folder it tries to open the connection but produces the exception Invalid value for key 'attachdbfilename' If I take out the dlls from the Plugins folder the program runs using the correct Abp database.

Ideally I would like to specify the connection string for my plugin within the plugin code but have not figured out how to do that as there is no Startup in the plugin.

Thanks for the suggestion. I had found the MultipleDbContextEfCoreDemo and was using it to go by but in my case I am trying to set the second dbcontext from the plugin. However, instead of adding a second dbcontext in the plugin I am somehow overriding the primary dbcontext.

I have been able to resolve the issue with the "invalid value for key 'attachdbfilename' issue though. I thought that was the source of the problem but it wasn't.

It is as was downloaded except for removal of the Google and Facebook isEnabled if clauses as these two authentication providers will never be enabled.

Thank you VERY much! I added the ValidateIssuer entry to the appsettings.json file and to the xxxWebHostModule.cs and it worked.

Thanks aaron.

Do you have any idea why the connection string would be null? I have put the static IP address in the Connection string in appsettings.json and can run it on the work station. I checked appsettings.Staging.json in the build\outputs\Host folder and it has the same connection string. (The docker ASPNETCORE_ENVIRONMENT=Staging") Also, do you know what the entries should be for ServerRootAddress and ClientRootAddress for docker?

Thanks

Thanks aaron for your help! The source of the problem was a snippet of code I had added while trying to create separate DbContexts for each of the plugin applications. This code was no longer needed but must have been interfering with the connection string when running in docker.

If I don't even change the Tenant on the Login popup leaving it as "Default" and click "Save" button I see in Fiddler a successful server-side call to /api/services/app/Account/IsTenantAvailable followed immediately by the unsuccessful call to the http://websitename.eastus.azurecontainer.io/account/login

in fact, if I enter the base http://websitename.eastus.azurecontainer.io the login screen appears and the "unknown' url appears in the browser url location: http://websitename.eastus.azurecontainer.io/account/login If I just move my cursor up to the browser url location and press Enter I get the same 404 error

The angular app did not contain a web.config on my local or Azure container. I just added the web.config from my development environment that came with the AspNetZero template into the Azure container (asset folder) and published it into Azure, restarted the app, but it didn't make a difference.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".json" />
      <mimeMap fileExtension=".json" mimeType="application/json" />
	  <mimeMap fileExtension="woff" mimeType="application/font-woff" />
      <mimeMap fileExtension="woff2" mimeType="application/font-woff" /> 
    </staticContent>
    <!-- IIS URL Rewrite for Angular routes -->
    <rewrite>
      <rules>
        <rule name="Angular Routes" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

I’m pretty sure it is an issue with the Url Rewrite – thanks for suggesting it. In a Linux container the web server is NGINX so the Url Rewrite has to be configured in the nginx.conf file not the web.config like for IIS I see the nginx.conf file got uploaded correctly on my local docker container which is why it is working. The file did not upload properly for the Azure container and, as a result, the Url rewrite does not work.

I now need to figure out how to load the nginx.conf file into the Azure Linux angular container.

Thanks,

Showing 1 to 10 of 12 entries