Base solution for your next web application

Activities of "justinp"

Solution:

  1. Went to NuGet package manager. (Right-click solution, and go to Manage NuGet Packages for solution)
  2. You should see updates above and an update for xunit.
  3. Install the udpate.
  4. Re-run Restore NuGet Packages.
  1. Downloaded v3.2.
  2. Extracted and opened api .sln.
  3. Tried to restore packages, but get this error:

Version conflict detected for xunit.extensibility.core. ApolloEHR.Tests (>= 1.0.0) -> xunit (>= 2.2.0-beta5-build3474) -> xunit.core (>= 2.2.0-beta5-build3474) -> xunit.extensibility.core (>= 2.2.0-beta5-build3474) ApolloEHR.Tests (>= 1.0.0) -> xunit.extensibility.execution (>= 2.2.0-beta2-build3300) -> xunit.extensibility.core (>= 2.2.0-beta2-build3300).

Question

I paid $850 USD for this product that is supposed to help speed up development. However, I spent the first week resolving an issue with the Angular UI to get the project to run with the release candidate Angular CLI (nothing suggested in the forum or sending in the code helped). Now a new version comes out (3.2) that is supposed to address exactly what I solved (working with the latest Angular CLI). No one told me that it was being fixed in the next release which would be out in days. That would have saved me a lot of effort. Solving the issue was a waste of my time when I could have focused on other things. That is bad customer service and support.

Now, I download version 3.2 and the API project won't even run. I've got all kinds of issues (posted throughout this forum, listed below) and something very simple, like running the EF commands to get the project to deploy the databases doesn't work.

  • Version conflict detected for xunit.extensibility.core. ...
  • Version 3.2 EF Error: Could not find file project.json
  • InvalidOperationException: Could not find 'UserSecretsIdAttr
  • Github project is missing...
  • Migrator Project Documentation is missing...

I don't want to work another week to solve these issues that shouldn't exist. I've lost two weeks when I should have been learning how to leverage all the multi-tenant capabilities. I don't have time to solve problems with other people's projects, and documentation is missing.

I want a working version of the software I paid $850 for now, or I want a refund.

I'm getting this error when trying to run the API project.

InvalidOperationException: Could not find 'UserSecretsIdAttribute' on assembly 'ApolloEHR.Web.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Could not find 'UserSecretsIdAttribute' on assembly 'ApolloEHR.Web.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Microsoft.Extensions.Configuration.ConfigurationExtensions.AddUserSecrets(IConfigurationBuilder configuration)

Microsoft.Extensions.Configuration.ConfigurationExtensions.AddUserSecrets(ICon

figurationBuilder configuration)

  1. Downloaded v3.2 and opened the API .sln.
  2. Modified the connection string to point to a database (used this same database previously, so it should work).
  3. Went to root directory of entity framework project and ran 'dotnet ef database update.'
  4. Get the following error:
Unhandled Exception: System.IO.FileNotFoundException: Could not find file 'D:\Users\Justin\Downloads\ApolloEHR\aspnet-core\src\ApolloEHR.EntityFramework\project.json'.

I went to upgrade to 3.2 and found this information in the FAQs. However, the Github project is just for documentation, not the code itself. Where is the code repository, how do we access it and how do we merge the changes with the previous code branch?

I just get a 404, even when logged in.

HOW TO UPGRADE EXISTING APPLICATIONS WHEN A NEW VERSION IS AVAILABLE? We can split updating to 2 parts:

1 - ASP.NET Boilerplate (the framework) and module-zero (base domain logic for user, role, tenant... management). They can be easily updated since they are distributed on nuget. Here, a list of all nuget packages:

<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Nuget-Packages">http://www.aspnetboilerplate.com/Pages/ ... t-Packages</a> <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Zero/Nuget-Packages">http://www.aspnetboilerplate.com/Pages/ ... t-Packages</a>

New releases generally are backward-compatible. If there is a breaking change, we add it to relase notes and document how to migrate. You can upgrade these nuget packages even after your license period ends, since they are open source. So, upgrading this part is easy. Just update nuget packages.

2 - AspNet Zero - the startup template: UI views and application services

This part is not developed as a 'closed' framework/library. Because different companies have very different needs and you will want to extend/change UI upon your needs. That's why we call AspNet Zero as a starter kit/template: All source codes of ASP.NET Zero is on your hands, you can freely modify it upon your needs.

In most cases you don't have to upgrade if you are happy with your solution. Even you might built the same feature yourself before us. If you like new features, you should adapt changes to your existing solution. In this case, Github repository will help you much (github.com/aspnetzero/aspnet-zero, requires purchasing ASP.NET Zero to access). You can compare releases and copy changed parts to your solution. For example, assume that we enhanced Audit Logs page with new features and you want to get these new awesome features. If you did not change this page, you can directly override your page and related classes. If you did change it, then you can see changes on Github and you can merge changes to your code. We also advice you to review each commit to check if it's also needed for you. Because some of they can be bugfixes.

Downloaded the new version (3.2) and ran into an issue running the APIj project: "InvalidOperationException: Could not find 'UserSecretsIdAttribute' on assembly 'ApolloEHR.Web.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."

However, I ran the project without running the database upgrade. So I circled back and read the documentation:

ASPNET ZERO MIGRATOR APPLICATION

AspNet Zero solution includes a .Migrator (like Acme.PhoneBook.Migrator) project in the solution. You can run this tool for database migrations on development and production (see development guide for more information).

However the development guide linked to does not contain any information on the Migrator project. Either the link needs to be fixed or the documentation is missing or both.

Answer

If the UI project can't find the back-end (API Project), then you'll get the forever spinning. Try to run both projects at the same time.

I got it all working and deployed to Azure. Just to be super-clear to anyone getting started with ASP.NET Zero v3.1, and the latest version of Angular CLI, here are the steps. All the previous steps for deploying the API are still valid, so this just applies to getting the angular portion deployed and working in Azure.

  1. Make sure you have the latest version of Angular CLI (@angular/[email protected]) by running 'npm list -g.' If you are having trouble, use the commands in my previous post to ensure you uninstall globally and that the cache is clear before installing the latest.

  2. Download your project files from ASP.NET Zero and extract them to wherever you will be working with them.

  3. From within 'angular' folder, run 'npm install' from a command prompt. This will create the 'node_modules' folder in side the angular folder with all the dependency files for the project.

  4. Open and modify the "environments" section of the angular-cli.json file according to this error message (you will get this error message if you run 'ng build --prod,' so if you forget, it will remind you):

To migrate angular-cli.json follow the example below:

Before:

"environments": {
  "source": "environments/environment.ts",
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}


After:

"environmentSource": "environments/environment.ts",
"environments": {
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}
  1. Run 'ng build --prod.'

You should now have a folder inside the 'angular' folder called 'dist' with 22 files and an assets folder, and can continue with the previous posts steps 9-11. The web.config file mentioned is now part of the files in the package, but doesn't get moved into the dist folder.

  1. Connect to your azure website's ftp and transfer files under dist folder to "/site/wwwroot/" of your azure website.
  2. Configure appconfig.json under "/site/wwwroot/assets" on your azure website.
  3. Add a web.config file under "/site/wwwroot/" which has below content. This will be included in our next release as well.

To configure the appconfig.json metioned in step 10, open it and change it to:

{
    "remoteServiceBaseUrl": "http://your-api-url.azurewebsites.net",
    "appBaseUrl": "http://your-angular-ui-url.azurewebsites.net"
}

You should now have a working instance deployed to Azure.

Enjoy.

I may have solved the issue. I want to post what I did in case someone else is getting started with ASP.NET Zero and Angular-Cli.

I realized (see post above) that 'ng' commands weren't working since going to the suggested @angular/[email protected]. However, prior to trying all this, I had managed to get a better result on my first attempt, when I didn't use Yarn or beta.31 of Angular CLI, but instead used npm install and the latest version of angular-cli. So I upgraded from beta31 back to the latest version, but was getting this error when running 'ng' commands:

ERROR in ./src/main.ts
Module build failed: TypeError: Cannot read property 'newLine' of undefined
at Object.getNewLineCharacter (C:\Users\Justin\angular\node_modules\typescript\lib\typescript.js:8062:20)
at Object.createCompilerHost (C:\Users\Justin\angular\node_modules\typescript\lib\typescript.js:44978:26)
at Object.ngcLoader (C:\Users\Justin\angular\node_modules@ngtools\webpack\src\loader.js:350:33)
@ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

So I did some searching and found this thread: <a class="postlink" href="https://github.com/angular/angular-cli/issues/5179">https://github.com/angular/angular-cli/issues/5179</a> and this thread: <a class="postlink" href="https://github.com/angular/angular-cli/issues/4895">https://github.com/angular/angular-cli/issues/4895</a>

So I ran these commands just to be sure that there wasn't some version confusion.

npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli
npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest

Now I have the following version of angular-cli when I run npm list -g

C:\Users\Justin\angular>npm list -g
C:\Users\Justin\AppData\Roaming\npm
+-- @angular/[email protected]

I made a fresh copy of the angular folder downloaded from ASPNET Zero, like I always do, and ran 'npm install,' because I found in that same thread from earlier someone mentioned that yarn install' might not be resolving dependencies, which confirmed my previous experiences.

Following that, ng commands gave me a different error, but one that was easily solvable:

C:\Users\Justin\angular>ng build --prod
Environment configuration does not contain "environmentSource" entry.

A new environmentSource entry replaces the previous source entry inside environments.

To migrate angular-cli.json follow the example below:

Before:

"environments": {
  "source": "environments/environment.ts",
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}


After:

"environmentSource": "environments/environment.ts",
"environments": {
  "dev": "environments/environment.ts",
  "prod": "environments/environment.prod.ts"
}

The error asks me to modify a section of angular-cli.json and even tells me what to change it to. After making the changes, ng commands worked again and I was able to execute 'ng build --prod,' which gave me the expected 'dist' folder and the following files inside:

Directory of C:\Users\Justin\angular\dist

03/04/2017  10:33 AM    <DIR>          .
03/04/2017  10:33 AM    <DIR>          ..
03/04/2017  10:33 AM         1,073,855 0.4e462baadfe61fa18041.chunk.js
03/04/2017  10:33 AM           304,427 1.05de1ea02987159b9eeb.chunk.js
03/04/2017  10:33 AM            89,863 2.f9ca5eca298a01e55870.chunk.js
03/04/2017  10:33 AM    <DIR>          assets
03/04/2017  10:33 AM            78,508 famfamfam-flags.d4a4d7b033f5ad8d7261.png
03/04/2017  10:33 AM           165,742 fontawesome-webfont.674f50d287a8c48dc19b.eot
03/04/2017  10:33 AM           444,379 fontawesome-webfont.912ec66d7572ff821749.svg
03/04/2017  10:33 AM            77,160 fontawesome-webfont.af7ae505a9eed503f8b8.woff2
03/04/2017  10:33 AM           165,548 fontawesome-webfont.b06871f281fee6b241d6.ttf
03/04/2017  10:33 AM            98,024 fontawesome-webfont.fee66e712a8a08eef580.woff
03/04/2017  10:33 AM               952 index.html
03/04/2017  10:33 AM             1,560 inline.8e8e16f4cb5e2d56d862.bundle.js
03/04/2017  10:33 AM           752,227 main.1b5ebc8a29e8ac7465e7.bundle.js
03/04/2017  10:33 AM            90,219 polyfills.6a520f9204459c96cb8b.bundle.js
03/04/2017  10:33 AM         1,637,023 scripts.dde78ae3c2579cbca7d4.bundle.js
03/04/2017  10:33 AM            30,064 Simple-Line-Icons.0cb0b9c589c0624c9c78.woff2
03/04/2017  10:33 AM           239,045 Simple-Line-Icons.2fe2efe63441d830b1ac.svg
03/04/2017  10:33 AM            81,332 Simple-Line-Icons.78f07e2c2a535c26ef21.woff
03/04/2017  10:33 AM            54,056 Simple-Line-Icons.d2285965fe34b0546504.ttf
03/04/2017  10:33 AM            54,266 Simple-Line-Icons.f33df365d6d0255b586f.eot
03/04/2017  10:33 AM            34,770 sprite.976b3b4f9512611cc0c3.png
03/04/2017  10:33 AM           257,312 styles.3559ec6f191a029a299f.bundle.css
03/04/2017  10:33 AM         1,483,095 vendor.bde8a4fca4fa837f64b6.bundle.js

I hope this helps someone that is facing similar issues and getting started with the latest versions of both ASP.NET Zero and Angular-CLI. I still need to get everything working across the Angular and API projects within Azure, but I'll come back and post when I have that done.

Showing 61 to 70 of 79 entries