Blazor WebAssembly (and fixing DevOps bugs)- A TimCo Retail Manager Video

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back to the timco retail manager course this course focuses on real world application development in this video we'll be cleaning up our build from last video and then i'll be adding to our new blazer web assembly product to the solution this will be the project that houses our admin portal and our user shopping section as well see a progressive web application it's going to have authentication and all that cool stuff so for those of you who are subscribers to my patreon at the five dollar per month level or higher head over to get the source code for today's video now for those of you who are new to this project welcome if you're just interested in the topic this video covers i think you'll get a great introduction into a real world setting for this topic now if you let us start the course from beginning there is a link in the description for the full playlist in order now there's also links down there for the phase one and phase two courses if you wanna get up to speed faster and like the source code for each step as well as the uh the downloadable videos in those courses plus the uh we also have certificate of completions for those courses and uh tracking for one what you've completed so that's we can get those courses or you can just use it free on the the playlist instead okay so let's head on over to visual studio now we left last time we had made some changes to our um our project to bring up the.net 5. so our web or our desktop ui project is now a dotnet 5 project however one of the things that we added was a nuget package this one right here which is actually a release candidate version as uh version 4.0.158-rc the problem is that's not on nuget.org the latest version on nougat does not yet support net 5. this is from the private not private this is from the uh the the private just to caliber michael i guess you could say it's still public but it's not part of the overall nuget feed it's on my git instead and that's what has the latest and greatest cutting edge caliber micro builds so those build are still a little slow to get to nougat because they're still working through the bugs and the kinks and making sure they have everything working before they move it over so we we're using the cutting edge stuff which can be good or can be bad and we've found that that for our case it's fine but that does mean that we have to have a link to that my get feed not just nuget.org that worked fine in development but when we went to our azure devops we go to our pipelines we'll see that our latest integration build is failing and the reason why is because of that uh missing package so if we go in here and we look it says new get comm well don't monster that um nougat command failed accident code of one the not compatible.net 5. well that's interesting and a restore didn't work okay so right there is one of our errors so one of our errors is that this entity framework core is for 3.1.1 not net 5 compatible and then the other is right down here unable to find package caliber and micro with that version okay so those two errors are problems for us so we're gonna work on fixing those first they should be pretty quick fixes the first one is that we're gonna go and look at all of our packages in all of our projects kind of do a review to see if we need to do some upgrades so let's go with dependencies on this this one first and look uncheck the pre-release and look for updates and sure enough we have some updates auto mapper that's a major version change i'm not going to touch that but these two go from 3.1.9 to 500 for microsoft extension so let's go ahead and upgrade those now we have six warnings but no errors so that should be good so far we're gonna do a full rebuild after this is done now let's go and look at our library which shouldn't have any major uh problems staying right where it's at because it is a dotnet standard but we'll still look and sure enough there are some updates but this is a net standard project i'm not sure if that will cause a problem or not um let's upgrade because it is a microsoft for both of those and we're going to see if if this causes any problems okay so the nice thing here is you may say well man you're really rushing into this are you sure it's all going to work no i'm not i have not pre-tested this but i'm using git and because i'm using git i can try things out with abandon because if things don't work i just roll back the changes and i start over where i start at the beginning this video so i can be pretty aggressive in in trying out things to see if we can get something that works the way it we want to okay there's a lot to change here so this is our api and these are all microsoft and swashbuckle packages now version six there is interesting because swashbuckle package that's a major update from five to six still depends on net standard version 2.0 though which should be okay so i'm going to upgrade all of these since it's not a third-party libraries except for swashbuckle which is kind of um it's still being shepherded by microsoft stuff and they they say they can upgrade just fine so we're gonna do this upgrade and accept since it said net standard 2.0 net standard works with both.net core 3.1 and net 5 and even net framework so having that there is is very nice because it gives us some flexibility so our library oops let's go into our actual library go dependencies that makes it easier to find the new get packages go to updates dapper i am not going to upgrade to dapper2.oh there is some changes there that i'm not sure if there are any breaking changes or not so i'll leave that alone but the microsoft packages i will upgrade and again i am on.net standards i don't have to but i will and the system.data.sql client that's a minor update so i will upgrade that as well okay so i've made those changes i'm going to do a clean solution which technically a rebuild does i like to clean the solution first anyways and then do a rebuild it's just kind of a habit of mine you don't have to you can just do a rebuild but i every once in a while i think that there's a quirk or two that causes the clean to be a little bit better okay so they're all built just fine if we start this up it should be that it starts just fine um the api started just fine our wpf project started and if we dive into it yes we can add things the car remove things from the car let's add quantity remove things from the cart all still works um so yeah i think that's where i count that as a win we can see the roles and all the rest so we'll call that good okay so that should take care of the entity framework core issue um we're gonna do a build to make sure that and we may also check our build agent as well because our build agent may be using.net core three instead of net five so let's check that out and make sure but then we also have to address this issue of caliburn micro and the fact that that version's not there so we're going to do is we're going to add to our um let's add it to our desktop ui project we're going to add a new file a new item and we want to add a config item let's see if we have um i don't only have the nuget.config that i want application configuration so it's going to call this nuget okay hit add and this is now a a configuration file and what this will do is will allow us to specify nuget feeds so in here i want to say package sources inside this i want to say add key equals we're going to call this uh just nuget.org as a standard and the value equals we're going to give the path which i don't have right yet that's okay and we'll close that tag out we'll add one more key equals uh caliburn micro uh mygit and the value equals we don't have that path yet either so these are just specifying where the feeds are you can give it whatever name you want for the key but the value needs to be the path for your nuget feed so for nuget.org we already have that let's go to dependencies manage nuget packages this is a quick way to get there and you see the package source up here where it says nougat and microsoft visual studio offline packages well if you click the gear icon you can modify these so nuget.org is this path right here so i copy that and notice this is in the options menu under nuget package manager package sources so you can get there through tools options and diving down i just find it's easier to go in under the right click menu so with that feed i can come back over here and paste that in right there that's the feed from microsoft that's the the standard nuget feed that we're all used to using but we also have this caliber micro feed which i happen to have and copy that from over my other screen and paste it in here now this is provided by caliber micro they said this is our private um or you know our personal i guess you could say their personal myget feed and so we're going to paste that in there and that will allow when we run this it will allow the system to pull from both locations okay so it's going to pull from both nougat.org and caliburn micro myget okay we're gonna save that and we're gonna check that into source control okay so there's all of our changes they've made the cool thing here is even if this were to somehow still break the build even if we find out later that that may i screwed something up when i did all those upgrades even though i'm doing a commit i can always roll back this particular commit and take out these changes so don't feel like you're even stuck once you've committed something i'm going to stage all of these now since they're all being staged i could have left it alone and it would have assumed everything gets staged but i like to specify like a stage just to make sure that um if there's anything in there i don't want staged that it gets uh removed okay so you can you could right click and say on stage and then that wouldn't get committed okay let's um upgraded nougat or upgrade nougat packages and feed upgrades the microsoft nougat packages to b.net five also adds the nuget dot config file for the private or a personal my get feed commit staged and now i'm going to do a fetch to see if anything that's going to be incoming first you always do your merges locally so by fetching i'm checking to see with anything to merge locally first and there's not so now i hit push to push those changes up to uh the cloud up to azure devops and we get in here now we see that we've got a bill that just kicked off and we'll see i think that i have to still modify this pipeline because i didn't specify what feed to use i'm not sure it's going to read from that nuget dot config file automatically if i have to specify i think it'll specify it so we'll watch this and see if it um works we just did a checkout so now here's grabbing the latest version of nougat and now we're starting to restore this is where we're gonna bomb out but we'll see and yes it did bomb out but not quite the way i expected to um which is usually the case so this error here it says errored right here this red line says package microsoft entity framework core dot sql server version 5.0.3 is not compatible with net50 or net5 the package supports net standard 2.1 well we're using net standard 2.0 so we need to make that modification and get to net standard 2.1 which will exclude us from working with net framework anymore we can still work with net core 3.1 and net 5 as well as xamarin but we can't work with net framework anymore which is fine we're fully past that in our upgrade process and it says the same thing down here as well for net standard 2.1 it also said unable to find package for caliburn micro okay so let's go back to this job and make a modification first we're going to go to pipelines click on the job itself and say edit and come down here a new get restore and well first let's look at the agent and make sure that um they are running the we're running 2019 which i believe should have net five shouldn't be a problem so nuget restore right here the feeds to use the feeds i saw here or feeds in my nuget.config file and where is that file that file is right here okay so those feats now we don't need any credentials for feeds outside the organization because we don't have to worry that they're it's a public feed um so that should work we're going to save this but not queue it because we also know we have a problem with our net core library so let's go back to pipelines and highlight this and then we're gonna go back to our timco retail manager make one more change and that is to bump up the versions here for net core or net standard to net standard 2.1 for that one and also for the api we'll move to net standard 2.1 and save that should work just fine um let's start that up it's going to launch just fine um so we can shut it back down but um with that now let's let's go back and look real quick at the the files themselves just to show you that's really all it is change that point o to 0.1 um no other change is necessary so with that let's go get changes we'll take these two changes we'll stage them and say bump to net cord app 2.1 and we'll commit and push because we know there's no changes on the server in that short period of time that we did make some changes okay with that this should kick off in just a minute uh with there you go a new build and we'll watch this build to see if it in fact um will work with our net core uh 2.1 and also if it will i'm sorry net standard 2.1 and also if it will um find our nuget packages okay so that's this is the key we're going to look at is is this part right here to make sure that it finds the right packages oh sorry next restore right there and this takes about 30 seconds i'll pause the video for you but um i'll come back once this is done the restore okay this is irritating me so the package build failed now we are using the correct feats notice there's two feeds here and there's no error in here for caliber and micro but we get this really weird error message the nuget command failed the exit code of one nu1201 project this lot the library so data manager.library is not compatible with net500 it supports nat standard 2.1 but net standard 2.1 supports net 5.0 so i don't understand why we're getting this message i'm confused if you have thoughts as to why this is i love to hear them down in the comments below um but we're going to make a change one more change and see if this works if not i'm going to bang my head against the wall until i figure out what the problem is so we can do is notice this project is net 5.0 for target framework if we come here and say net 50 we can change this to a a dotnet 5 well that's giving me a oh oh you know what i think i'm gonna i didn't change this microsoft.net sdk um no that's correct so i'm not sure why unless i have to do a a rebuild here but usually this changes over to net core project without a problem um we'll see if it has a problem now and still y'all need saying as a net standard project um that's interesting that should be a dot net core at this point um we're gonna figure this out i think this might need to be a reload so let's do this let's um change the other one as well because this is all it is to change the dotnet five so net50 is a target framework now instead of uh net standard so with that let's restart visual studio so i close it down i'm going to restart the the project load it all back in once we do we're going to right click and go to properties and there we go so it did find it after all for both of these and now it says yeah it's net five so the only the only um thing was an ide refresh essentially that needed to happen because it was net 5 just by doing that so again we're going to start this up again i didn't do a full rebuild but if it runs then that's all we need and of course it does run we hit log in here logs in we add things to the cart we can remove things in the cart so it seems to all be working at least enough that's that should be fine so let's go back and get changes move to net five state your changes and this the reason i'm showing you all this instead of being perfect about this instead of um you know showing you the outcome where everything looks great and all works fine um it's because this is how real work happens um you think this is a really simple little change and it really was um you know it feels like it but then you actually try and do it and it takes you 20 minutes to do because you're banging your head against the wall as to why your build server isn't accepting the new changes because it works locally so why doesn't it work on your machine too um this you know it works on my machine well that's what this is right now is it work it's working locally so if this does not work i'm gonna have to investigate if azure devops is having a problem with net5 that's the next thing to look at is maybe our build server is the problem itself and maybe it's trying to build a net core 3.1 instead of net five but i think it's trying to use net five because otherwise i think we have more problems than what we're having right now so we're gonna keep you know we're gonna try this again i'm gonna pause it here and wait for it to be complete like e4 but if this doesn't work we've got to investigate further into azure devops i think what i'll do is i'm going to move on either way after this and we're going to build our blazer web assembly piece i want to get that in place i mean that's the whole point of this video really this is just a quick cleanup that took 20 minutes but um i want to get that in place because we've got a lot of work to do in order to get blazer web assembly up and running i wanted to do this clean up and that blade web assembly at the same time because in the next video we're going to be adding authentication from our api and that's a little tricky so um we're going to make sure that we figure out how to do that right and we have a failure excellence this task has failed two times across two pipelines around the last 14 days thanks for that we know okay so desktop ui.library is not compatible with net 550-windows um project supports net5-oh so i think this is a builds through a problem i don't think it's an us problem i think it's a build server problem because yes the net 50 does support net 50 windows dash windows is just an additional thing that we add on so it can absolutely support a net 50 library in fact we're running it so therefore yes it works so this is this is definitely something to look into on azure devops we're going to look into this more in the next video probably but if we go and look at this pipeline here and go to edit i'm guessing it has to do with the agent specification here i'm wondering if the windows 2019 does not have the latest version of net and if we need to work on on getting a different build server and as i say all that i have one more thing to try because it says windows 2019 but i have come across one thing and that's this um this dotnet core task which we can add and we can move this up to the top right up here and here we can say i think custom custom oh no i think that's this is the wrong one let's go back to add again and if we search for use dot net core i think this is the one so if we move this up one um so use dot net core sdk and the version number we choose let's do uh 5.0 dot x can we do that i think we can do that the version number here yes so we can do the x version so we're going to say that version 5.0 point whatever you know whatever the latest version is use that so let's let's save and cue this because i'm a glutton for punishment and what's one more filling build um i really hate seeing filling builds so if i can fix it i keep poking it until i fix it but sometimes if it's just not working then you need to step away and come back to it but we're going to try this and we'll see how it works and nope that didn't work again um but now i have another theory we're not going to try it because this is going on long enough and you see me keep poking at this but my next theory is the fact that this nougat restore here is not using a dot net restore and i'm wondering if that's the the issue there because this shouldn't be making a judgement call here um this is just working so we do have the option if we go to this pipeline instead of doing the new get restore like this we can do a net new get restore notice in the net you can have um uh in here is nougat uh nougat push we don't want that we can do a restore right here so i i think that's the next step but we're gonna pause it right there we're not going to keep going um like i said down in the comments let me know if you think i'm on the right track i think that's the issue but we're going to stop right there with with messing with this we have fixed the caliber micro issue we just now have an issue with net 5 in general on the build server like i said i think that will fix it we'll see in the meantime let's go back over here to our our solution and we need to add i think another folder here because we have the api we have our wpf project we have our database project and our solution items which is just the roadmap but i think we need one more folder at least and this folder could be called um i think we'll call it blazer or let's call it web apps called web apps because we may have more than one um but for now we're gonna start with our blazer web assembly project we call this blazer web assembly or blazer projects then the issue is that we have a folder for one project and that doesn't seem like it's very useful so we'll still have one project in here for now but eventually may have more than that so let's right click and say add new project and we're going to choose a blazer application and we give this a name now it's always good to review i'm going to close this out so i was gonna review what you got for names trm api trm data manager.library trm desktop ui trm desktop ui.library i hate that naming convention um it kind of worked but at the same time i hate it so let's talk about if we name this differently because this is going to be our um both our admin portal and potentially our shopping portal as well unless we decided to separate the tube i don't think we're going to ally has a reason to so this could be you know trm uh blazer or this could be that doesn't describe what it does this could be trm portal um which kind of works um maybe call it trm portal and call it good we could skip the trm naming convention and just call it portal that might work so the question is do we stick with naming conventions because that's the way the rest of the system does it or do we say yeah we kind of want to change those conventions so let's go in slightly different direction i think i kind of want to go a different direction here i want to start going towards a more simplistic but clear name so i kind of like portal so this is gonna be a portal for all the temco retail manager application so let's call it portal and for product type we've got our server or we have webassembly now a lot of ways this is a fairly easy choice because the benefit of server is that you have that web application that sits on both sides of the line you have it it sits on the server side and it has a server-side benefits of compiling your code and your code never goes the client your client never sees c sharp code and you can have secrets right in blazer server because they never go to the client and yet it's compiled on the server which is faster but it's also compiled on the client side as well to give that rich ui that um that the uh users have come to expect and like that you know angular does and react and view but yet it's still a c-sharp application so it kind of sits in the on the you know the middle ground there and does both and gives you the benefits of both server side and side but we don't we already have an api for our back-end code so we already have an api to handle all of the the security stuff and the the business logic and all the rest we need a just a user interface and so blazer web assembly gives us some benefits here that blazer server doesn't blaze web assembly can work offline now it's a fully client-side application which is how i can work offline but that does mean that it's going to have more of an initial download of the client than if we were on blazer server it's much it's not much it's slower to start than a blazer server application is but the benefit here is that once you've got the application downloaded then you're just transferring the data itself which isn't quite as efficient as the signalr connection for blazer server but at the same time it's very efficient but it can also do things like caching data and working offline that's pretty cool and so since we already have that api to support it i'm going to choose blazer webassembly to get that offline access to get that progressive web application access so we're going to choose blazer web assembly now for authentication i'm going to say none we're gonna this would add authentication as if we're gonna connect to a asp.net core hosted application we're not gonna do that we're going to roller not roll our own authentication we're going to set up microsoft authentication but connected to a custom api not to one pre-built for us so we're going to leave it alone we are going to say https yes and we're not going to say asp.net core hosted okay that's it's a really small checkbox we're not going to say hosted what this hosted is is it creates an api for you and then what it does is it launches that api and your blazer web assembly app at the same time and then your webassembly app will connect that api easily but it kind of tangles the two together and we don't need to create an api we already have one existing that would be redundant work that we don't want to do we also don't want to have two different authentication databases we don't want to try and sync those we're going to use the one we have and that's it that's our api so therefore don't check that box we are going to check the box for progressive web application that's the pwa and that's going to put in a manifest file and a service worker so that we can have offline access for our application now we're not going to set that up or configure that at least not not gonna configure it today we'll configure that in the future once the application's up and running you can kind of check that box and leave it alone until you're ready to go to production so you can configure that at any point we're gonna do that later in the process once we have this actually working and then we'll install on a phone i might even do a video of it on my phone with offline access because that's some pretty cool stuff you can do now um one quick side note is that by default pwas are not enabled for offline access in debug mode so on your own machine you can't get to work offline that's just it's a design feature because if it was not like that then what would happen is you'd have some refresh problems when you're trying to debug where the latest code wasn't always on there because that's how offline access works so just know offline access does not work on your machine by design and it's to help you debug faster so when it comes to debugging offline access you actually have to deploy it to a phone or something else but we can show how to do that in the future okay so check that one box blazerwebassembly.net5 and create this will create our application for us we're not going to go much further than this we're going to get our portal up and running and make sure it works so we'll do is we will um let's let's just start just this project we're going to set the startup project so it's just the portal it's not connecting the api which we'll have to do but i just want to get it to run so we know we have something working so launching it and takes a few seconds the first downloads but we now have a portal so hello world to the survey no i don't i don't think so notice in the upper right hand corner we have the the plus button here we click that and say do you want to install the app it's called portal here's where it goes to and there's the cool little icon for it you hit install and that will install as a desktop app we're not gonna do it today but that is possible to do so right now out of the box this does not have any kind of authentication system this does not have a system for um log in log off protecting certain piece of data it has just temporary data or dummy data in here so we're gonna fix all of that but i want to at least get this set up and going in our project check it into source control because i want to have that portal prepped and ready for next time when we add authentication now there's one other thing i want to do while we are um you know in here because this portal is a web application and because it's going to operate a different url than our api we need to modify our api in fact we need to go to startup here and in configure services we need to modify this to allow what's called cores which is a cross origin requests so what that means is a request from one url to a different url now for right now we're going to do is we're going to allow requests from any url and say any url can talk to our api which may sound like you know the default thing that should happen but there is some things that you might want to think about when it comes to do you allow certain api or certain uh websites to talk to your api or not but cores is not really a security thing it's it's just not because you can get around cores very easily so don't think of it as a security service so we're going to turn it off though so it can it can work across any url that way we can just make sure that in testing it works and also when we publish to azure that it works as well so in our configure services method in the startup.cs file of our api make sure it's in the api in here we want to say services dot add course okay and we're gonna set up policy we have no we're set up a policy sometimes intellisense gets too smart for its own good he escape so a policy is going to be that policy dot ad policy i'm going to call this the our um open course policy which is you know allow everything basically and we're gonna put comma after that and we're gonna say the options opt um and the arrow and then let's do a new line here because let's do a couple new lines otherwise it's going to be crowded we're going to say dot allow oops opt dot allow any origin and then we're going to say a new line dot allow any header and then a new line dot allow any method and then we'll we'll close that off with we need one more cr uh parent so and then semicolon two so this says is we're going to create a new policy for our course and the new policy is being named open course policy and the options are allow any origin allow any header and allow any method so that's saying is allow from anywhere so if it's google tries to access our api sure go ahead you're allowed if microsoft.com wants to access our api sure go ahead and just you know coors is only talking about websites accessing your api this has nothing to do with desktop apps or services they can access regardless of course they they don't cores do not apply to them so this is about websites accessing your api it can be any allow any headers meaning we're not going to filter which headers are allowed to be in the header we're going to say if it doesn't matter what headers you have go ahead and pass them in and then finally allow any method now you may think does that mean any method in my api well yeah kinda um because remember our api is a whole bunch of http verbs so you got your gets your posts you get your puts and your deletes those are the big four um saying allow any of those now you could say only allow get and post you could do that or you could say only allow get and delete but that's it or just get but we're going to say any method go ahead and call it not a problem use any of them okay so that's our policy so we've set it up in our services that's our dependency injection system to allow course but we're not quite done yet we have to scroll down here and look for the configure method that wasn't configured services method now the configure method we're going to right after this um use https redirection we're going to say app dot use course and we need to have that policy name which i totally forgot by now it's open course policy yep open course policy i'm going to copy that copy paste your friend here um paste that you know right there so this is where we use that course policy we set it up up above and now we're using it if you forget this step you've not actually enabled anything okay so you need to enable it right here now i put it right after https redirection before static files you can put it after select files it's not a problem but it gets a little tricky to get to app use routing and authentication authorization so put it above user routing okay some of these do matter in their order some don't i need to throw them wherever but i put things above use routing by default okay so that's our big change for our api so that we can call that from our blazer app when we're ready now that's not until uh the next time we do a video on this because that's when we're gonna deal with um the the issues with the uh authentication and trying to authenticate against our api but that way we're all set up for it okay so get changes we've got a lot of them i'll go up to the top here and just say stage for everything and then scroll through here to make sure that the the list looks right um don't just stage things to stage things if you find something you don't want in here or you want to change then take it out okay but for me everything looks fine i think that's all good so we're going to leave it as is and we're going to say add blade blazer wasm app also configured cores on api and we're gonna stage this um we're gonna stage it i'll make one quick change because i hate not knowing why things are working let me one quick change to the um to add your devops all right i made a change i'm gonna push these up and i'm going to uh pause the video here i'll let you know if it works tonight if it does i'll show the changes and why i made it but if not then we can wrap things up and it worked so i figured it out which is great i mean you know it it's better than not working i guess it's just one of those either bang your head against the desk often enough and then you figure out what the problem is so let's go look at this job i'm going to um whoops i'm going to configure this so let's go to edit and look what i did i took out this nuget restore because this is the old way of doing things and so i went now with the.net restore so net restore this command restore the path the the project is the same as what i use in nougat and then down here still use the same feed in my nuget.config and i point to that and that's it i just changed that instead of my nuget restore and now when it ran it restored just fine with net five and let's look at the um the latest version of this let's go to the agent job and look at the restore here and notice there's a lot more stuff in here but one of the things it does is sdk version is 5.0.103 that's the latest version of net5 so it is working it is using the right version of dot net 5 and if you scroll on here if you want to look um there's you know there's some stuff in here but it all worked it all restored properly there's a lot of stuff going on a lot of stuff is uh 7 000 lines with five warnings the um the warnings here looks like the restorer target uh for the sql project may missing requirements just restore and also down here there's four warnings we've had for a long time um in the solution file for the api project it's got some references to old versions of net framework instead of.net core we're going to investigate that one these days it still works and i'm not sure that they're actually being used um for in the net framework version but um they're not causing any problems so you just need to investigate and figure out and figure this out and clean them up but with that it did all of our work including the publishes so now our api is running properly in the right environment and it should be kicking off yep there's the linux release has worked and now the windows deployment is in progress now we've added the blazer project but have not yet added to our pipeline so we'll need to do that at some point i'm going to hold off on doing that until it actually works there's no reason to deploy an application that is an empty shell especially since if we're deploying and accidentally deploy it to production that would be bad because then you have a app in production that's not doing anything and if people find it they might think that your site is worthless and never come back to it even though it's not yet ready so in order to avoid that just don't put in your pipeline don't put your pipeline until you're ready to actually have it working at least in-depth and that's what we'll do this is our dev pipeline we haven't set up a production pipeline this is our dev pipeline and so we're going to get this running once we have something to run all right so we'll modify that in the future but for now that's it so we've banged her head against the desk a few times but we got our build pipeline to work so our build pipeline finally does a build and it makes those changes for our new get restore we did change all of our packages over upgrade all of our nuget packages or most of them to the latest versions all the.net 5 stuff we upgrade our packages and we upgrade our class libraries to net5 which means they can now use uh c-sharp 9 code so that's good that's actually kind of a bonus there we also add our blazer webassembly project to our solution we tested it actually runs as default solution and our adult default project and then we also add the course policy to our api so that in the next lesson when we connect to our authentication server with our api that we can actually talk to without any problems so that's all set up it's all working and it's building and deploying that's kind of awesome so that's it for this video i hope you enjoyed it i hope you realize this is kind of how real world works so when you're working on a project and it doesn't work and you're frustrated and you think that you know it you know i felt this way where you feel like man i'm just not smart enough um you know what maybe that's true but you're also just like me okay and so if you think that that you'd like to be in my shoes someday then just know you're still gonna have those problems we're still gonna come across issues where you just don't know why it doesn't work it should work and you just bang your head against the desk and you can't figure it out and you keep poking at it that's that's the big key here that's the the key that will separate you from being a junior developer and moving up towards a scene developer is is not that you don't have problems because all of us have problems always have issues we come across some can be the stupidest thing in the world even as a senior developer but the thing that really separates you as you develop is the ability to stick with it if you can stick with it and not get overly frustrated frustration is fine because it happens i get frustrated at things i bang my head against the desk i you know get irritated the project and why why don't you work and you know all this kind of stuff but the key is to stick with it because if you stick with it and if you keep working the problem you don't just assume things but you you put on your investigative hat and you look at all the different possibilities that's when you start to see progress because you know the the error i knew i had i knew i had the error with our let's pull it up here with the wpf project because the wpf product used that nuget package that i knew was not on nuget.org so i knew the solution and so i'm like oh we're going to fix this real quick we're going to add you know a nuget.config file we're good to go and that was my assumption and with that fell through i could have gotten stuck on that and say well why isn't that working why isn't it but i read the error messages that's critical read the error message and yeah that was in the error message but there was also other errors and honestly my first thought was well maybe they're red herring errors maybe they're not really errors and once they you know fix the nougat issue that'll fix the other problems and that can be the case sometimes so fix one problem at a time but then when that doesn't work then you gotta look at the other problems and and i took it one step at a time okay it says it's had problem with um with net five well i know that you know those nuget packages are out of date so let's update the new get packages we did that and didn't work but honestly that probably moved us closer to the solution because yes those nuget packages worked in local but maybe they shouldn't have or maybe at least they need to be upgraded and so i upgraded those it didn't solve a problem but doesn't mean it wasn't a valid step and so after we did that then we said okay well what else could it be well maybe move it.net 5 instead of net standard 2.1 so we did that and then that didn't work but that's still a valid step now if i didn't want to go a.net five i could have rolled back at that point but it's fine to go down at five in fact there's some benefit there for our uh project so i did that and then with that didn't work again i i didn't lose my cool i didn't just you know walk away and say you know this is stupid i'm gonna quit and become a carpenter um instead i said okay what's next and it really bugs me when things don't work right but i've learned to channel that into a investigatory mode where okay that's not working i need to figure out why and so i i focus my frustration my energy on finding solutions instead of just whining about the problem so you know you have to put your investigative hat on you you look around and say hey you know what you know in this thing there's one thing that's that's different than all the rest you know this is different than this we used to have these steps these um these build steps that look like these like a visual studio build step and this looks like a nougat step but now i looked around and said hey you know what they have this use.net core which that's going to force us to use net5 because it says five but that probably won't apply to this and so you would change that around to be a dot-net restore instead of a nuget restore and you know all of that combined the end solution was used.net core5 and then do a net restore instead of doing a new get restore okay all of that work for those two little tweaks but finding out what the two little tweaks were took all that work and it's not lost work that's not lost time for two reasons one is i got to do some upgrades to my system now if i had to roll all those back it still wasn't valuable and the the reason why because of the second reason why it's valuable and that is i got to learn what doesn't work and that may sound like nothing it may sound like man i don't care but it's important because the next time i come across this error and i will come across this error again i'm sure of it it may not be the net 5 it may be with net 7. who knows there'll be a time when i come across an error similar to this i'm gonna think about go wait wait wait let's make sure that we're on the right version of net core and let's try it again because if we change the right version.net core that may solve the problem and so you know knowing what didn't work and what does work allows me in the future to be quicker about my diagnostic work but i may still do the same things i may still have to do the other things as well but at least i'll switch the order up and check for the version of net core we're using for the build before i check the version of net core that is the projects because it worked locally so that seemed like that was the place to go okay so i just want to make sure that you are aware this is a valid this is a normal process and the more you embrace it and the more you say you know what this is my job my job is to find these weird bugs and fix them my job is to track down why things don't work and make them fixed or make them work okay that's my job and yes my job is to write cool code too but whenever you write code you're also gonna have to fix bugs that's just how it works so if you embrace that if you learn to grow in your investigative process if you learn to learn from your mistakes and to not hold yourself as liable for problems okay i could beat myself up over oh you know stupid i should have known that no i didn't know that i do now and going forward i'm a little better armed when it comes to diagnosing this problem but this is the first time i faced it this way so i learned something new cool okay i'm not gonna beat myself up over it i did it on video in front of thousands of people that's okay okay i'm okay with that because i am human i'm a developer who does not know everything and if you thought you were following a person who knows everything you're wrong okay and it's okay so i encourage you to take that same mindset none of us are born knowing this stuff this stuff changes all the time there's always gonna be things that that trip you up that cause problems that might not cause something else a problem but that's okay okay so sorry for a little bit of a tangent i want to make sure that i really kind of beat this home because it's important to your development as a developer that you embrace these problems learn how to investigate these problems learn how to be okay with having problems and and really come out of the other end as a better developer not as a frustrated and beaten down developer okay thanks for watching thanks for participating uh thanks for following this journey um through the the bugs and the frustration i can't wait to see you next time on on the next step in this process we're gonna have a lot of fun with authentication for sure um i've already kind of done some practice work on that because that's a big one and i think that um there's some really big learning opportunities there so i look forward to seeing you next time in this temco retail manager series thanks for watching and i am tim corey
Info
Channel: IAmTimCorey
Views: 7,011
Rating: 4.9263802 out of 5
Keywords: .net, C#, Visual Studio, code, programming, tutorial, course, training, how to, tim corey, C# course, C# training, C# tutorial, C# app start to finish, timco, timco retail manager, wpf, asp.net, .net core, blazor webassembly, cors, azure devops, blazor webassembly tutorial, .net 5
Id: 7Hj9ULsF9bY
Channel Id: undefined
Length: 59min 38sec (3578 seconds)
Published: Mon Feb 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.