Base solution for your next web application
Open Closed

Can no longer get .NET Core + Angular v8 to run #8019


User avatar
1
wizgod created

Greetings Programs!

I cannot get .NET Core v8 to run at all, even from a clean install.

  • I unarchive the project.
  • I use the defaults and update-database and run; which gets me the login screen successfully and I can see Swagger just fine.
  • I've used both npm and Yarn to do the initial install.
  • I go to the nswag folder and do a refresh; which appears to complete successfully.
  • I do a npm/yarn start and the errors below are thrown.

Thanks,

Wg

yarn version v1.19.1 info Current version: 7.3.0

$ npm version { 'abp-zero-template': '7.3.0', npm: '4.6.1', ares: '1.15.0', brotli: '1.0.7', cldr: '35.1', http_parser: '2.8.0', icu: '64.2', modules: '64', napi: '4', nghttp2: '1.34.0', node: '10.16.0', openssl: '1.1.1b', tz: '2019a', unicode: '12.1', uv: '1.28.0', v8: '6.8.275.32-node.52', zlib: '1.2.11' }

Angular CLI: 8.3.19 Node: 10.16.0 OS: win32 x64 Angular: 8.2.14 ... animations, common, compiler, compiler-cli, core, forms ... platform-browser, platform-browser-dynamic, platform-server ... router

Package Version

@angular-devkit/architect 0.803.19 @angular-devkit/build-angular 0.803.19 @angular-devkit/build-optimizer 0.803.19 @angular-devkit/build-webpack 0.803.19 @angular-devkit/core 8.3.19 @angular-devkit/schematics 8.3.19 @angular/cdk 8.2.3 @angular/cli 8.3.19 @ngtools/webpack 8.3.19 @schematics/angular 8.3.19 @schematics/update 0.803.19 rxjs 6.5.3 typescript 3.4.5 webpack 4.39.2

ERROR in ./src/account/login/login.service.ts 169:37-54 "export 'AuthenticateModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/login.service.ts 332:24-49 "export 'ExternalAuthenticateModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/login.service.ts 267:28-53 "export 'ExternalAuthenticateModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/login.service.ts 292:32-57 "export 'ExternalAuthenticateModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/login.service.ts 313:28-53 "export 'ExternalAuthenticateModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/login.service.ts 354:24-49 "export 'ExternalAuthenticateModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/login.service.ts 58:2-32 "export 'ExternalLoginProviderInfoModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/send-two-factor-code.component.ts 61:24-50 "export 'SendTwoFactorAuthCodeModel' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/shared/service-proxies/service-proxy.module.ts 44:16-55 "export 'TokenAuthServiceProxy' (imported as 'ApiServiceProxies') was not found in './service-proxies' ERROR in ./src/account/login/login.service.ts 383:41-62 "export 'TokenAuthServiceProxy' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/login.service.ts 372:16-37 "export 'TokenAuthServiceProxy' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/send-two-factor-code.component.ts 75:16-37 "export 'TokenAuthServiceProxy' was not found in '@shared/service-proxies/service-proxies' ERROR in ./src/account/login/send-two-factor-code.component.ts 85:12-33 "export 'TokenAuthServiceProxy' was not found in '@shared/service-proxies/service-proxies' i 「wdm」: Failed to compile.

ERROR in src/account/login/login.service.ts(9,10): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'AuthenticateModel'.
src/account/login/login.service.ts(9,29): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'AuthenticateResultModel'.
src/account/login/login.service.ts(9,54): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'ExternalAuthenticateModel'.
src/account/login/login.service.ts(9,81): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'ExternalAuthenticateResultModel'.
src/account/login/login.service.ts(9,114): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'ExternalLoginProviderInfoModel'.
src/account/login/login.service.ts(9,146): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'TokenAuthServiceProxy'.
src/account/login/login.service.ts(35,14): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(36,14): error TS2339: Property 'clientId' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(37,14): error TS2339: Property 'additionalParams' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(94,26): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(98,33): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(102,33): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(223,27): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(226,42): error TS2339: Property 'clientId' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(239,34): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(244,53): error TS2339: Property 'clientId' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(251,34): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(255,46): error TS2339: Property 'clientId' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(261,34): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(265,34): error TS2339: Property 'name' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(274,37): error TS2339: Property 'clientId' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(279,27): error TS2339: Property 'additionalParams' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(280,43): error TS2339: Property 'additionalParams' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(288,45): error TS2339: Property 'additionalParams' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(289,43): error TS2339: Property 'additionalParams' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(290,52): error TS2339: Property 'additionalParams' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(291,45): error TS2339: Property 'clientId' does not exist on type 'ExternalLoginProvider'.
src/account/login/login.service.ts(323,58): error TS2345: Argument of type 'number | ExternalLoginProvider | (<U>(callbackfn: (value: ExternalLoginProvider, index: number, array: ExternalLoginProvider[]) => U, thisArg?: any) => U[]) | { <S extends ExternalLoginProvider>(callbackfn: (value: ExternalLoginProvider, index: number, array: ExternalLoginProvider[]) => value

is S, thisArg?: any): S...' is not assignable to parameter of type 'ExternalLoginProvider'. Type 'number' is not assignable to type 'ExternalLoginProvider'. src/account/login/send-two-factor-code.component.ts(5,10): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'SendTwoFactorAuthCodeModel'. src/account/login/send-two-factor-code.component.ts(5,38): error TS2305: Module '"Project/angular/src/shared/service-proxies/service-proxies"' has no exported member 'TokenAuthServiceProxy'. src/shared/service-proxies/service-proxy.module.ts(32,27): error TS2339: Property 'TokenAuthServiceProxy' does not exist on type 'typeof import("Project/angular/src/shared/service-proxies/service-proxies")'.


14 Answer(s)
  • User Avatar
    2
    rvanwoezik created

    I can confirm this, i have the same

  • User Avatar
    0
    wizgod created

    Also, there are some projects that target .NET Standard instead of .NET Core 3.0. In a class library that I am using, some items are not compatible with .NET Standard and require .NET Core 3.0.

  • User Avatar
    2
    wizgod created

    Looking at the swagger api ui, I found that the TokenAuth service isn't being generated.

  • User Avatar
    0
    kpmg created

    In Startup.cs in Web.Host project add

    services.AddMvc();
    

    after

    services.AddControllersWithViews(options =>
                {
                    options.Filters.Add(new AbpAutoValidateAntiforgeryTokenAttribute());
                }).AddNewtonsoftJson();
    

    Start backend. TokenAuth Api should now be generated. Refresh services proxies.

  • User Avatar
    1
    wizgod created

    Hi kpmg,

    I placed it as you suggested: ` //MVC services.AddControllersWithViews(options => { options.Filters.Add(new AbpAutoValidateAntiforgeryTokenAttribute()); }).AddNewtonsoftJson();

            services.AddMvc();
    
            services.AddSignalR(options => { options.EnableDetailedErrors = true; });
    

    `

    I deleted all the bin/obj folders and restarted the project but it still did not generate the TokenAuth api.

    Thanks,

    Wg

  • User Avatar
    0
    alexanderpilhar created

    I have the same problem. @kpmg's answer did not solve the problem for me.

  • User Avatar
    0
    alexanderpilhar created

    It works!

    I just cleaned and rebuilt (not just build; that didn't do anything it seems) the solution (multiple times), regenerated services-proxies and all is fine now.

    I also implemented a simple change to Startup.cs by @maliming (not sure if this is important to the problem): Adjust the Authorization middleware order.

  • User Avatar
    0
    wizgod created

    @alexanderpilhar, thanks for the note about rebuilding multiple times; I got it working after this without the need to call AddMvc().

    With @alexanderpilhar, suggestion, I did the following:

    1. Unarchive project.
    2. Change connection string.
    3. Update-Database
    4. Build -> Rebuild Solution
    5. Run solution - no TokenAuth api.
    6. Build -> Rebuild Solution again.
    7. Run solution - TokenAuth api generated.

    Thanks,

    Wg

  • User Avatar
    0
    bosalah created

    Same here ! I have the same problem. all answers did not solve the problem for me.

  • User Avatar
    0
    amasanad created

    Same here !

  • User Avatar
    0
    amasanad created

    PS D:\PCO Project\PCO\PCO\angular> yarn yarn install v1.19.1 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... success Already up-to-date. Done in 0.73s. PS D:\PCO Project\PCO\PCO\angular> npm run hmr

    [email protected] hmr D:\PCO Project\PCO\PCO\angular gulp buildDev && ng serve --host 0.0.0.0 --port 4200 --hmr

    [00:23:58] Using gulpfile ~~***************\gulpfile.js~~ [00:23:58] Starting 'buildDev'... Dynamic bundles are being created. [00:24:10] Finished 'buildDev' after 12 s WARNING: This is a simple server for use in testing or debugging Angular applications locally. It hasn't been reviewed for security issues.

    Binding this server to an open connection can result in compromising your application or computer. Using a different host than the one passed to the "--host" flag might result in websocket connection issues. You might need to use "--disableHostCheck" if that's the case. NOTICE: Hot Module Replacement (HMR) is enabled for the dev server. The project will still live reload when HMR is enabled, but to take advantage of HMR additional application code is required' (not included in an Angular CLI project by default).' See https://webpack.js.org/guides/hot-module-replacement for information on working with HMR for Webpack. To disable this warning use "hmrWarning: false" under "serve" options in "angular.json". 10% building 4/4 modules 0 activei 「wds」: Project is running at http://0.0.0.0:4200/webpack-dev-server/ i 「wds」: webpack output is served from / i 「wds」: 404s will fallback to //index.html

    chunk {main} main.js, main.js.map (main) 2.15 kB [initial] [rendered] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 149 kB [initial] [rendered] chunk {polyfills-es5} polyfills-es5.js, polyfills-es5.js.map (polyfills-es5) 531 kB [initial] [rendered] chunk {runtime} runtime.js, runtime.js.map (runtime) 31.2 kB [entry] [rendered] chunk {scripts} scripts.js, scripts.js.map (scripts) 1.54 MB [entry] [rendered] chunk {styles} styles.js, styles.js.map (styles) 2.03 MB [initial] [rendered] chunk {vendor} vendor.js, vendor.js.map (vendor) 342 kB [initial] [rendered] Date: 2019-11-26T21:24:26.940Z - Hash: 6e3d08b822b98511cde2 - Time: 11195ms

    ERROR in app/main/registerations/serviceProviderOrgs/create-or-edit-serviceProviderOrg-modal.component.ts:4:10 - error TS2305: Module '"*************/angular/src/shared/service-proxies/service-proxies"' has no exported member 'ServiceProviderOrgsServiceProxy'.

    4 import { ServiceProviderOrgsServiceProxy, CreateOrEditServiceProviderOrgDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ app/main/registerations/serviceProviderOrgs/create-or-edit-serviceProviderOrg-modal.component.ts:4:43 - error TS2305: Module '"*****************/angular/src/shared/service-proxies/service-proxies"' has no exported member 'CreateOrEditServiceProviderOrgDto'.

    4 import { ServiceProviderOrgsServiceProxy, CreateOrEditServiceProviderOrgDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ app/main/registerations/serviceProviderOrgs/serviceProviderOrgs.component.ts:3:10 - error TS2305: Module '"****************/angular/src/shared/service-proxies/service-proxies"' has no exported member 'ServiceProviderOrgsServiceProxy'.

    3 import { ServiceProviderOrgsServiceProxy, ServiceProviderOrgDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ app/main/registerations/serviceProviderOrgs/serviceProviderOrgs.component.ts:3:43 - error TS2305: Module '"******************/angular/src/shared/service-proxies/service-proxies"' has no exported member 'ServiceProviderOrgDto'.

    3 import { ServiceProviderOrgsServiceProxy, ServiceProviderOrgDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~ app/main/registerations/serviceProviderOrgs/view-serviceProviderOrg-modal.component.ts:3:10 - error TS2305: Module '"****************/angular/src/shared/service-proxies/service-proxies"' has no exported member 'GetServiceProviderOrgForViewDto'.

    3 import { GetServiceProviderOrgForViewDto, ServiceProviderOrgDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ app/main/registerations/serviceProviderOrgs/view-serviceProviderOrg-modal.component.ts:3:43 - error TS2305: Module '"***************/angular/src/shared/service-proxies/service-proxies"' has no exported member 'ServiceProviderOrgDto'.

    3 import { GetServiceProviderOrgForViewDto, ServiceProviderOrgDto } from '@shared/service-proxies/service-proxies'; ~~~~~~~~~~~~~~~~~~~~~ shared/service-proxies/service-proxy.module.ts:8:27 - error TS2339: Property 'ServiceProviderOrgsServiceProxy' does not exist on type 'typeof import("**************/angular/src/shared/service-proxies/service-proxies")'.

    8 ApiServiceProxies.ServiceProviderOrgsServiceProxy, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/ ** i 「wdm」: Failed to compile.

  • User Avatar
    0
    drenton created

    Has anyone resolved this issue without "clean, rebuild" until it works?

    I cannot make this work.

    Everything is properly generated but TokenAuthController.

  • User Avatar
    0
    alexanderpilhar created

    I stumbled across this issue for another time just the day before yesterday. Again, I just cleaned and rebuilt the solution a couple of times and also had to restart Visual Studio / reopen the solution. Actually, I have no idea what causes this problem but I think you just have to be patient with the cleaning and rebuilding : /

  • User Avatar
    0
    jtallon created

    Same issue for me - thanks for the steps to fix