@mentium the only difference with my steps, is that i leave the field "Working Folder" empty on "npm build" also make sure you select version 0.*
Just found out that I need to add one more step. The web.config needs to be copied from the root repository to the deploy folder on azure.
I tried with "Copy Files" Source folder: (empty = root repo) Contents: web.config Target Folder: $(build.artifactstagingdirectory)
It passes this step without a problem, but the file is not copied, so the app wont work. Any ideas?
I upgraded all nuget packages for the new v5.2.0 version. I get an error when running the webhost. Although the page is loaded and i see all the services:
The source map 'swagger-ui-bundle.js.map' for file 'mdha:http://localhost:22742/swagger/swagger-ui-bundle.js' could not be read from the specified location due to error 'Exception of type 'TypeScriptSourceMapReader.SourceMapReadFailedException' was thrown.'.The source map 'swagger-ui-standalone-preset.js.map' for file 'mdha:http://localhost:22742/swagger/swagger-ui-standalone-preset.js' could not be read from the specified location due to error 'Exception of type 'TypeScriptSourceMapReader.SourceMapReadFailedException' was thrown.'.
At the bottom of the swagger page, is see an error button. When I click on it, i get
{"schemaValidationMessages":[{"level":"error","message":"Can't read from file /swagger/v1/swagger.json"}]}
what to do?
I got it to work!!
thanks @ismcagdas for the missing piece
Add these steps to the Build definition:
1. Use Yarn 1.x
2. Yarn
3. npm (select version 0.*) :
command = install
arguments = -g @angular/cli
4. Command Line:
Tool = $(Build.SourcesDirectory)\node_modules\.bin\ng.cmd
Arguments = build -prod
5. Azure App Service Deploy => $(System.DefaultWorkingDirectory)/dist
It gets deployed and I can go to the angular app url. Just need to find a way to easily change the appconfig.json file when building, because i dont want to change the remoteServiceBaseUrl and appBaseUrl everytime i want to debug
changed it, this is the Error:
AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.
Mapping types:
User_0982A06B3D7A322931BE27D128726007A283D673C9DCFF4BE6024F5FF709CCB8 -> UserEditDto
System.Data.Entity.DynamicProxies.User_0982A06B3D7A322931BE27D128726007A283D673C9DCFF4BE6024F5FF709CCB8 -> TIB.TIBtv.Authorization.Users.Dto.UserEditDto
at lambda_method(Closure , Object , Object , ResolutionContext )
at AutoMapper.Mapper.AutoMapper.IMapper.Map[TDestination](Object source)
at TIB.TIBtv.Authorization.Users.UserAppService.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Threading.InternalAsyncHelper.d__5`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Abp.Threading.InternalAsyncHelper.d__3`1.MoveNext()
Now I found this: <a class="postlink" href="https://stapp.space/run-angular-cli-react-cli-aurelia-or-vue-cli-build-in-vsts/">https://stapp.space/run-angular-cli-rea ... d-in-vsts/</a>
So instead of npm, i added a "command line" task with Tool: $(Build.SourcesDirectory)\node_modules.bin\ng.cmd Arguments: build -prod
But when executing the build i get this error: 'D:\a\1\s\node_modules.bin\ng.cmd' is not recognized as an internal or external command, operable program or batch file. Process completed with exit code 1.
However, if I look in my local folder, after using Yarn, the node_modules, folder is present, and there is ng.cmd. Should I just add node_modules in my source control?
Just to be clear, I'm using VSTS with a build definition just for the Angular App and associated code.
These are the steps I have now
I do not have a node_module in my master branch code.
thx for the info. I only need to build and deploy the angular solution. I am using Yarn indeed, but dont I need "ng build -prod" to create the "dist" folder?
Hi guys,
I'm trying to setup a CI setup for the angular app. But i'm not sure how to do it correctly. I tried something but got this error on "npm install":
2018-02-14T09:58:22.3947388Z [command]C:\Program Files\nodejs\npm.cmd install --force
2018-02-14T09:58:23.1148738Z npm WARN using --force I sure hope you know what you are doing.
2018-02-14T09:59:04.0232802Z npm WARN deprecated [email protected]: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
2018-02-14T09:59:22.7598061Z npm ERR! code EINTEGRITY
2018-02-14T09:59:22.7609655Z npm ERR! sha1-0sMepJKyK2qNiHrqFZiaI4/AhK4= integrity checksum failed when using sha1: wanted sha1-0sMepJKyK2qNiHrqFZiaI4/AhK4= but got sha1-s+4q3E2tVI1K6ZiZT1rIAtx1O4Y=. (16980 bytes)
2018-02-14T10:00:16.2216749Z
2018-02-14T10:00:16.2217856Z npm ERR! A complete log of this run can be found in:
2018-02-14T10:00:16.2218157Z npm ERR! C:\npm\cache\_logs\2018-02-14T09_59_22_783Z-debug.log
2018-02-14T10:00:16.3425967Z ##[error]npm failed with error: C:\Program Files\nodejs\npm.cmd failed with return code: 1
2018-02-14T10:00:16.3455803Z ##[section]Finishing: npm install
How did I fell into this? I am using the standard Aspnetzero code, without adjustments...
this is where the mapper is called: UserAppService > GetUserForEdit
//Editing an existing user
var user = await UserManager.GetUserByIdAsync(input.Id.Value);
output.User = user.MapTo<UserEditDto>();
output.ProfilePictureId = user.ProfilePictureId;
foreach (var userRoleDto in userRoleDtos)
{
userRoleDto.IsAssigned = await UserManager.IsInRoleAsync(input.Id.Value, userRoleDto.RoleName);
}
then what do I have to change to get this working again?