Base solution for your next web application

Activities of "ashjackson"

Hi There,

I have successfully created my own custom modules (core, shared, application etc) to hold my own code, so that all code I write is kept in separate modules and separate .net projects from the supplied Zero code - However, the 1 area I can't seem to work out from the documentation is can I add a second DBContext for my entities so this too can be kept separate from the supplied code in it's own module?

I will use the same connection string, but in my context will specify a schema name so SQL Server will treat my context as a separate DB in the same file.

Thankyou in advance for your guidance.

AJ.

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? - 9.2.1
  • What is your product type (Angular or MVC)? - Angular
  • What is product framework type (.net framework or .net core)? - .net core

Hi, I have installed the the first time the power tools and created new entity (fully auditied of Guid) and associated module, rebuilt the host project, run nswag update as outlined in the documentation Angular has recompiled but now gives the following exception

core.js:4081 ERROR Error: Uncaught (in promise): Error: Component 'CompaniesComponent' is not resolved: templateUrl: ./companies.component.html

  • Did you run and wait for 'resolveComponentResources()'? Error: Component 'CompaniesComponent' is not resolved: templateUrl: ./companies.component.html
  • Did you run and wait for 'resolveComponentResources()'? at Function.get (core.js:25940) at getComponentDef (core.js:1833) at verifyDeclarationsHaveDefinitions (core.js:25637) at Array.forEach (``) at verifySemanticsOfNgModuleDef (core.js:25609) at Function.get (core.js:25567) at getInjectorDef (core.js:395) at R3Injector.processInjectorType (core.js:11114) at core.js:10986 at core.js:1136 at resolvePromise (zone.js:832) at resolvePromise (zone.js:784) at zone.js:894 at ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:27126) at ZoneDelegate.invokeTask (zone.js:420) at Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:601)

As this appeared to be an angular error I dug around and found that the resolution to this issue was to add an explicit module id to the component declaration like this

<span class="colour" style="color: rgb(212, 212, 212);">@</span><span class="colour" style="color: rgb(78, 201, 176);">Component</span><span class="colour" style="color: rgb(212, 212, 212);">({</span> <span class="colour" style="color: rgb(156, 220, 254);">templateUrl</span><span class="colour" style="color: rgb(156, 220, 254);">:</span><span class="colour" style="color: rgb(212, 212, 212);"> </span><span class="colour" style="color: rgb(206, 145, 120);">'./companies.component.html'</span><span class="colour" style="color: rgb(212, 212, 212);">,</span> <span class="colour" style="color: rgb(156, 220, 254);">encapsulation</span><span class="colour" style="color: rgb(156, 220, 254);">:</span><span class="colour" style="color: rgb(212, 212, 212);"> </span><span class="colour" style="color: rgb(78, 201, 176);">ViewEncapsulation</span><span class="colour" style="color: rgb(212, 212, 212);">.</span><span class="colour" style="color: rgb(79, 193, 255);">None</span><span class="colour" style="color: rgb(212, 212, 212);">,</span> <span class="colour" style="color: rgb(156, 220, 254);">animations</span><span class="colour" style="color: rgb(156, 220, 254);">:</span><span class="colour" style="color: rgb(212, 212, 212);"> [</span><span class="colour" style="color: rgb(220, 220, 170);">appModuleAnimation</span><span class="colour" style="color: rgb(212, 212, 212);">()],</span> <span class="colour" style="color: rgb(156, 220, 254);">moduleId</span><span class="colour" style="color: rgb(156, 220, 254);">:</span><span class="colour" style="color: rgb(212, 212, 212);"> </span><span class="colour" style="color: rgb(156, 220, 254);">module</span><span class="colour" style="color: rgb(212, 212, 212);">.</span><span class="colour" style="color: rgb(156, 220, 254);">id</span> <span class="colour" style="color: rgb(212, 212, 212);">})</span> <span class="colour" style="color: rgb(212, 212, 212);"></span> Is this a bug in the power tools, or have I done something wrong? Please advise if I should update the template (and how) or if I need to do something else to enable use of the power tools correctly.

Kind Regards, AJ.

Hi there,

This is the generated json file.

{
  "IsRegenerate": false,
  "MenuPosition": "main",
  "RelativeNamespace": "Gpl.Companies",
  "EntityName": "Company",
  "EntityNamePlural": "Companies",
  "TableName": "Companies",
  "PrimaryKeyType": "Guid",
  "BaseClass": "FullAuditedEntity",
  "EntityHistory": true,
  "AutoMigration": false,
  "UpdateDatabase": false,
  "CreateUserInterface": true,
  "CreateViewOnly": true,
  "CreateExcelExport": true,
  "IsNonModalCRUDPage": false,
  "IsMasterDetailPage": false,
  "PagePermission": {
    "Host": false,
    "Tenant": true
  },
  "Properties": [
    {
      "Name": "Code",
      "Type": "string",
      "MaxLength": 6,
      "MinLength": 3,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": true,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_BusinessName",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": true,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_Name",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": true,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_Phone",
      "Type": "string",
      "MaxLength": 50,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": true,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_Email",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": true,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_Address1",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": false,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_Address2",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": false,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_City",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": false,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_Area",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": false,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": false,
        "List": false,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Contact_PostCode",
      "Type": "string",
      "MaxLength": 10,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": false,
        "CreateOrUpdate": true
      }
    },
    {
      "Name": "Name",
      "Type": "string",
      "MaxLength": 250,
      "MinLength": 0,
      "Range": {
        "IsRangeSet": false,
        "MinimumValue": 0.0,
        "MaximumValue": 0.0
      },
      "Required": true,
      "Nullable": false,
      "Regex": "",
      "UserInterface": {
        "AdvancedFilter": true,
        "List": true,
        "CreateOrUpdate": true
      }
    }
  ],
  "NavigationProperties": [],
  "NavigationPropertyOneToManyTables": [],
  "EnumDefinitions": [],
  "DbContext": null
}

Kind regards, AJ

Hi There,

CompaniesComonent is decared in main.module.ts. My power tools version is 2.7.2

AJ.

Probably related - I can log in, but cannot download 10.0.0-rc1. Click generate, and the spinner shows, but then nothing happens. Re-generating 9.3.0 does work. I have selected netCore31 + Angular.

AJ.

Hi There, The newest power tools version has resolved this problem. The additional module id field is no longer required.

Thanks.

Question

Prerequisites

  • What is your product version? V10.1.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? net50

Hi There,

I have some AppConsts set in the API project for various fieldlengths - are these exposed anywhere in the angular project to save duplication when validating input?

Kind Regards, AJ.

Prerequisites

  • What is your product version? V10.1.0
  • What is your product type (Angular or MVC)? Angular
  • What is product framework type (.net framework or .net core)? .NET50

Hi There,

I am trying to deploy V10.1 to an azure app service. I have select .net50 (Early Access) and deployed the app using the publish wizard. I have tried both self contained and framework dependant publishing options and the same error occurs on both.

I get the following error message in the application log

<div class="content-container"><h3>HTTP Error 500.0 - Internal Server Error</h3><h4>The page cannot be displayed because an internal server error has occurred.</h4></div><div class="content-container"><fieldset><h4>Most likely causes:</h4><ul> 	<li>IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.</li> 	<li>IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.</li> 	<li>IIS was not able to process configuration for the Web site or application.</li> 	<li>The authenticated user does not have permission to use this DLL.</li> 	<li>The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.</li> </ul></fieldset></div><div class="content-container"><fieldset><h4>Things you can try:</h4><ul> 	<li>Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.</li> 	<li>Check the event logs to see if any additional information was logged.</li> 	<li>Verify the permissions for the DLL.</li> 	<li>Install the .NET Extensibility feature if the request is mapped to a managed handler.</li> 	<li>Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>. </li> </ul></fieldset></div>

The web.config file generated by the deployment is as follows

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\MSystem.Web.Host.exe" stdoutLogEnabled="false" stdoutLogFile="\\?\%home%\LogFiles\stdout" hostingModel="inprocess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 9fc37c62-2105-4d32-9724-7323b959504b-->

Kind Regards, AJ.

Frustratingly, this error isn't happening today. The only thing that could have changed is that the app-service will have timed out and shutdown overnight (it's on the shared hosting for dev purposes, so spools down when not in use).

I see I'm not the only person who's seen this, so shall we leave this thread open for a bit as I'll be deploying a lot in the next week or so and I'll see if I can catch the cirumstances required to produce this issue and capture the log.

Kind Regards, AJ.

Hi, Just to confirm, this has happened again when deploying to a new Azure app service with 10.1. I set the log streaming to verbose but get nothing more than the IIS error message

HTTP Error 500.30 - Internal Server Error The page cannot be displayed because an internal server error has occurred. Most likely causes:

  • IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
  • IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
  • IIS was not able to process configuration for the Web site or application.
  • The authenticated user does not have permission to use this DLL.
  • The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Things you can try:

  • Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
  • Check the event logs to see if any additional information was logged.
  • Verify the permissions for the DLL.
  • Install the .NET Extensibility feature if the request is mapped to a managed handler.
  • Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click <a href="http://go.microsoft.com/fwlink/?LinkID=66439">here</a>.

More Information: This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.<p><a href="http://go.microsoft.com/fwlink/?LinkID=62293&amp;IIS70Error=500,30,0x8007023e,14393">

My other site when left overnight, just started working so I'm at a loss to point to what might be wrong here. I see others are reporting the same problem - have you been able to recreate the issue?

AJ.

Showing 1 to 10 of 22 entries