1
00:00:01,080 --> 00:00:05,679
How'd you like to listen to dot
NetRocks with no ads? Easy? Become

2
00:00:05,679 --> 00:00:09,839
a patron for just five dollars a
month. You get access to a private

3
00:00:10,000 --> 00:00:14,240
RSS feed where all the shows have
no ads. Twenty dollars a month.

4
00:00:14,279 --> 00:00:18,839
We'll get you that and a special
dot NetRocks patron mug. Sign up now

5
00:00:18,839 --> 00:00:37,280
at Patreon dot dot NetRocks dot com. Hey guess what it's dot NetRocks.

6
00:00:37,439 --> 00:00:41,039
It's twenty twenty four. I'm Carl
Franklin. That's Richie Campbell. Hey,

7
00:00:41,320 --> 00:00:44,200
I am so all day? Yeah
every time. How you doing, buddy?

8
00:00:44,560 --> 00:00:47,560
I follow me everywhere. Sometimes I
forget my name and I check it.

9
00:00:47,880 --> 00:00:51,960
Sometimes I think I'm Joe Boxer,
but I'm not. Due's Joe Boxer.

10
00:00:52,039 --> 00:00:55,240
Is that a Canadian thing? Is
the name on my underwear? Oh?

11
00:00:55,280 --> 00:00:59,840
All right, it's like, what
is that Canadian fruit of the loom?

12
00:01:00,240 --> 00:01:03,679
Yeah, I don't think I would
be named fruit, but Joe Joe

13
00:01:03,719 --> 00:01:11,359
works. I'm the grapes you go, just fermented nicely. So how was

14
00:01:11,439 --> 00:01:15,480
your you know, New Year's and
Christmas and all that, well, and

15
00:01:15,480 --> 00:01:18,040
everything's changed now we sold the big
house in the city. You know,

16
00:01:18,560 --> 00:01:21,040
I'm still working on the whole how
do you sell this smart home thing?

17
00:01:21,599 --> 00:01:25,120
But you know, now we don't
have the big house in the center of

18
00:01:25,159 --> 00:01:29,000
the family anymore, right, so
things move around. So the younger daughter

19
00:01:29,079 --> 00:01:33,319
hosted the Christmas meal, which was
fun. Oh that's cool. That's got

20
00:01:33,359 --> 00:01:36,519
to be great for her. Huh
yeah. Yeah, But it just brings

21
00:01:36,560 --> 00:01:40,920
back the memory for me when we
got that house in two thousand of my

22
00:01:41,000 --> 00:01:46,120
father looking through it at first Christmas
going okay, you're it. That's right.

23
00:01:46,239 --> 00:01:49,760
Yeah, I'm not doing it anymore. I't and I ever felt that

24
00:01:49,840 --> 00:01:55,040
way per se, but suddenly we're
in this position. Yeah. But you

25
00:01:55,079 --> 00:01:57,439
know, the other thing is there
is a guesthouse up here. So the

26
00:01:57,519 --> 00:02:01,000
older daughter and her business partner or
they're working from here for the next two

27
00:02:01,040 --> 00:02:04,560
weeks. So they came up right
after New Year's and just so we have

28
00:02:04,599 --> 00:02:07,640
dinner most nights and that kind of
thing. So it's like we're living in

29
00:02:07,640 --> 00:02:09,319
a little village right now. Yeah, we're gonna have a quiz on Richard's

30
00:02:09,400 --> 00:02:14,319
life a personal life after the show, So get out your pen you're all

31
00:02:14,360 --> 00:02:16,360
paying attention in pencil. But if
you're yeah, that's very very cool.

32
00:02:16,560 --> 00:02:20,800
Just be aware when I'm recording.
Here, I'm looking out at the ocean

33
00:02:20,840 --> 00:02:23,360
as well, like that's the life. Yeah, I'm in the coolest studio

34
00:02:23,400 --> 00:02:27,639
I've ever owned, so yeah,
no, it's it looks great. And

35
00:02:28,360 --> 00:02:30,639
Jimmy Bogart is here. We're going
to talk to him in just a few

36
00:02:30,639 --> 00:02:40,599
minutes. But first, Better Know
a Framework? Awesome, a hard man,

37
00:02:40,639 --> 00:02:43,319
what do you got? All right? So it's been a while since

38
00:02:43,360 --> 00:02:47,560
I explained better No a Framework.
It started out as just a piece in

39
00:02:47,599 --> 00:02:51,719
the beginning of the show where I
find a little piece of the dot neet

40
00:02:51,759 --> 00:02:54,319
framework, maybe a name space or
a class or something you didn't know was

41
00:02:54,360 --> 00:02:59,879
there, and talk about it.
And that quickly got old, and then

42
00:03:00,039 --> 00:03:04,520
it became I it was several years
of talking about the framework. Well yeah,

43
00:03:04,560 --> 00:03:07,199
but this is the problem when you
do a show for twenty years is

44
00:03:07,759 --> 00:03:09,479
eventually you get through the framework,
you get through the framework right, and

45
00:03:09,520 --> 00:03:13,919
you run out of things, and
then you know, it becomes more interesting

46
00:03:13,960 --> 00:03:17,479
to find things that are going on
in the world and just spotlight them.

47
00:03:17,560 --> 00:03:23,240
So that's that's what it is.
And today's spotlight is speaking of dot net

48
00:03:23,360 --> 00:03:30,400
eight migrations. This is a class
that I'm going to be teaching online in

49
00:03:30,960 --> 00:03:38,800
January here January twenty seventh called Essential
Blazer in dot net eight. So it's

50
00:03:38,840 --> 00:03:46,039
a one day hands on remote class
with Zoom and I've got a link to

51
00:03:46,080 --> 00:03:52,280
it there on the website. And
also, because this is episode eighteen eighty,

52
00:03:52,439 --> 00:03:55,599
if you go to eighteen eighty dot
pop, dot me or Blazer dot

53
00:03:55,599 --> 00:03:59,439
appnix dot com, you'll get to
it. Awesome, it's an event bright

54
00:03:59,520 --> 00:04:02,599
page and I'm really really looking forward
to it. See. This is the

55
00:04:02,599 --> 00:04:06,120
cool thing is that this is what
I do. I say, hey,

56
00:04:06,159 --> 00:04:10,840
I'm teaching this class and that forces
me to go through all my materials and

57
00:04:10,960 --> 00:04:14,400
update it. And oh no,
you announced the class before you finished writing

58
00:04:14,439 --> 00:04:16,360
it. Goodness knows, well,
I have the I have the content,

59
00:04:16,480 --> 00:04:19,240
but it needs to be updated,
it needs to be migrated, and then

60
00:04:19,560 --> 00:04:25,720
you know, re explained within the
context of eight. I got asked for

61
00:04:25,800 --> 00:04:29,079
new geek outs for twenty twenty four, so I say, I sat down

62
00:04:29,079 --> 00:04:31,120
and wrote two great abstracts. I
can't wait to see what the talks are

63
00:04:31,160 --> 00:04:36,439
like. Yeah, that's kind of
a reality in our world. Is that's

64
00:04:36,519 --> 00:04:39,839
it? You know what I really
like? How about this? And I

65
00:04:39,839 --> 00:04:42,120
said, out this abstract, you're
like, yeah, do that. I'm

66
00:04:42,160 --> 00:04:46,199
like, no, damn. But
that now it's the fun part. You've

67
00:04:46,199 --> 00:04:50,079
given yourself a deadline and you know
you can do it. It's not that

68
00:04:50,160 --> 00:04:54,399
you can't, so I mean,
and let's be clear, it's how to

69
00:04:54,439 --> 00:04:59,560
become a space fearing civilization and understanding
nuclear power, two things I can probably

70
00:04:59,639 --> 00:05:02,360
cough for an hour. I think
I'll actually, you know, finish the

71
00:05:02,399 --> 00:05:06,879
research right right, and okay,
So that's what I got. Who's talking

72
00:05:06,879 --> 00:05:12,079
to us today? Richard ah Grab
a comment off of show eighteen sixty two,

73
00:05:12,120 --> 00:05:14,839
the one we did back in September
one. Jimmy Bogard maybe've heard of

74
00:05:14,879 --> 00:05:17,800
him, never heard of when we
were talking about his open source project or

75
00:05:17,839 --> 00:05:21,759
one of the ones that he's involved
with, Mediator, and Jimmy Scott said,

76
00:05:21,920 --> 00:05:25,959
this is about right after the show
publishing, he sent this message.

77
00:05:25,959 --> 00:05:29,560
He said, we use Mediator for
persistence of our settings in a solution,

78
00:05:29,680 --> 00:05:32,759
and it's a dream when it compared
to the service locator pattern, which sucked.

79
00:05:33,519 --> 00:05:38,279
I understand sub drawbacks of Mediator,
lots of tiny classes in direction,

80
00:05:38,519 --> 00:05:43,160
but the key advantages far outweigh those. The centralization of data persistence logic,

81
00:05:43,199 --> 00:05:47,959
which can be invoked from other than
web APIs easily testable logic, and mediators

82
00:05:47,959 --> 00:05:54,000
delegating handler pattern easily decorate requests with
common handling logic. Yeah, oh,

83
00:05:54,279 --> 00:05:57,519
Jimmy, I think you got a
fan there. I guess so, making

84
00:05:57,680 --> 00:06:00,279
one of the many. Yeah,
without a doubt. I mean, we'll

85
00:06:00,279 --> 00:06:03,120
pass out a lot to Jimmy.
Look to Jimmy's and thanks so much for

86
00:06:03,160 --> 00:06:05,360
your commented. A copy of music
Koba is on its way to you.

87
00:06:05,519 --> 00:06:08,279
And if you'd like a copy of
music, go buy. I rite a

88
00:06:08,279 --> 00:06:11,600
comment on the website at dot NetRocks
dot com or on the facebooks. We

89
00:06:11,600 --> 00:06:13,879
publish every show there, and if
you comment there and everything on the show,

90
00:06:14,040 --> 00:06:15,920
we'll send you a copy of music. Go by. And you can

91
00:06:15,959 --> 00:06:17,759
follow us on Twitter if you want
to. But the cool kids are hanging

92
00:06:17,759 --> 00:06:21,920
out on Mastodon these days. I'm
at Carl Franklin at tech hub dot social,

93
00:06:23,040 --> 00:06:26,319
and I'm Rich Campbell at mastadon dot
social. Send us a tuote,

94
00:06:26,360 --> 00:06:29,319
a tweet, an ex, a
poot, whatever the heck you call um,

95
00:06:29,560 --> 00:06:31,879
just get it to us any of
those things. I got an account

96
00:06:31,920 --> 00:06:35,240
on threads now and blue Sky and
they're all kind of fun. They are

97
00:06:35,319 --> 00:06:39,519
kind of fun. Yeah, you
know they each I like the smaller communities.

98
00:06:39,519 --> 00:06:42,439
That reminds you of why we liked
social media in the first place.

99
00:06:42,560 --> 00:06:46,920
That's what I love about being on
masted On is that there's just not there's

100
00:06:46,920 --> 00:06:51,079
no advertising, there's no crap.
It's just good stuff. All right.

101
00:06:51,160 --> 00:06:56,240
Let's bring Jimmy Boguard on. Of
course he's been on many times before.

102
00:06:56,279 --> 00:07:00,319
He's the creator and maintainer of the
popular OSS libraries, Auto Mapper and Mediator.

103
00:07:01,399 --> 00:07:06,519
Jimmy's an independent software consultant based in
Austin, Texas, and he has

104
00:07:06,600 --> 00:07:11,800
received the MVP Award every year since
two thousand and nine. Welcome back,

105
00:07:11,879 --> 00:07:15,160
Jimmy. Good to see again.
Yeah, I need to punch your frequent

106
00:07:15,160 --> 00:07:18,639
flyer card there. I think it's
number six including an open source panel,

107
00:07:18,800 --> 00:07:26,000
So yeah, she is. I
think I think you are more than the

108
00:07:26,079 --> 00:07:29,439
number of episodes you've done. It's
just a number of times you're referred to

109
00:07:29,959 --> 00:07:33,319
YEA as the kind of the right
way to do open source, like when

110
00:07:33,360 --> 00:07:38,199
a nice person does the right thing
by a project that sort of gets out

111
00:07:38,199 --> 00:07:42,160
of control. I think of Jimmy
Bogart just like the madness that you ended

112
00:07:42,240 --> 00:07:45,399
up with automapper. Oh you didn't
have to like bleep out something after they

113
00:07:45,600 --> 00:07:48,680
mentioned my name. I also think, Jimmy, that you're a real generalist,

114
00:07:49,040 --> 00:07:55,519
and you know, your knowledge and
experience is vast horizontally as well as

115
00:07:55,600 --> 00:08:01,279
vertically. I remember being in Nonslow
maybe some with you overseas, and it

116
00:08:01,360 --> 00:08:05,600
was before the conference started, and
we were just sitting down maybe at breakfast

117
00:08:05,680 --> 00:08:11,279
or something, and just riffed on
messaging, you know, enterprise messaging.

118
00:08:11,439 --> 00:08:20,399
And do you remember that conversation?
No, I have a lot of but

119
00:08:20,519 --> 00:08:26,000
you know, you can remember having
conversations like that, I'm sure because it

120
00:08:26,079 --> 00:08:31,679
was just great. It's really cool
to have conversations with somebody who has this

121
00:08:31,840 --> 00:08:35,759
knowledge that he doesn't get to share
with most people. But you know,

122
00:08:35,840 --> 00:08:39,679
these two people meet that you know, Oh yeah, enterprise messaging. Let's

123
00:08:39,679 --> 00:08:43,879
talk about that for an hour.
It's great. Okay, Now I am

124
00:08:43,919 --> 00:08:48,519
remembering this conversation now, because again
I don't it doesn't seem like people do

125
00:08:48,559 --> 00:08:52,879
that very much in maybe the Dinaut
space, I'm not sure, but it's

126
00:08:54,039 --> 00:08:56,000
one of those things like once you
get introduced to you like, oh,

127
00:08:56,039 --> 00:09:01,200
there's this whole like universe of this
technology that is really cool, but just

128
00:09:01,240 --> 00:09:03,799
not a lot of people get to
touch it very much. Yeah, true,

129
00:09:03,879 --> 00:09:07,960
app it. That's also a space
where it's a way of thinking when

130
00:09:07,000 --> 00:09:11,120
you're building software at a certain scale
or a certain level of complexity. And

131
00:09:11,159 --> 00:09:13,720
if you're in that space, like, it's really awesome, and if you're

132
00:09:13,759 --> 00:09:16,120
not, it's just people are looking
at you like why would you do that?

133
00:09:16,120 --> 00:09:20,600
That seems unnecessary? Like, well, look, come on, guys,

134
00:09:20,679 --> 00:09:24,799
let's talk about fishing or seinfeld or
something normal. I don't know they

135
00:09:26,039 --> 00:09:28,679
I mean, you guys love talking
about messaging. I don't mind talking about

136
00:09:28,679 --> 00:09:31,519
messaging either. But the one that
I have to stop myself on home assistant,

137
00:09:31,799 --> 00:09:35,159
Like, if you're into home Assistant, we could talk for days.

138
00:09:35,399 --> 00:09:41,200
If you are not, don't do
it. Just not Ye. Anyway,

139
00:09:41,240 --> 00:09:45,559
we were gonna talk about work because
you've been up to stuff. Yeah,

140
00:09:45,759 --> 00:09:50,399
yeah, I think this topic is
like that was my life for about twelve

141
00:09:50,399 --> 00:09:54,639
months, twelve to eighteen months.
I'm doing this modernization migration effort. So

142
00:09:54,840 --> 00:10:00,919
before the shipping of dot net,
you were moving an app to to eight

143
00:10:01,080 --> 00:10:05,000
or just to the modern version of
dot net. So this is actually to

144
00:10:05,120 --> 00:10:07,360
dot net six. And then eventually
it did migrate to dot et eight.

145
00:10:07,360 --> 00:10:11,679
But the big jump was to dot
net six initially from dot net four eight,

146
00:10:13,159 --> 00:10:18,080
Right, so what's the big hurdle
getting rid of ASP dot net web

147
00:10:18,080 --> 00:10:22,879
forms? Oh god, okay,
so yeah that was I mean, the

148
00:10:22,240 --> 00:10:28,799
first big thing we had to worry
about was just what exists in their current

149
00:10:28,840 --> 00:10:33,559
system and then what is the migration
path to something over on dot net six?

150
00:10:33,879 --> 00:10:37,879
And web forms is one of those
things like there is no straightforward path.

151
00:10:37,919 --> 00:10:41,159
It is a just a straight up
re write. So there may be

152
00:10:41,200 --> 00:10:43,799
like conversion tools to Blazer or something
like that, but the web forms as

153
00:10:43,799 --> 00:10:48,039
a model does not exist in dot
net core or whatever you want to call

154
00:10:48,080 --> 00:10:50,879
it. Dot Net six seven eight
just doesn't exist. So do you just

155
00:10:50,960 --> 00:10:56,200
rewrite those pages in your favorite flavor? Go Razor pages or Blazer or whatever

156
00:10:56,240 --> 00:10:58,840
makes you happy. Pretty much,
we've got some folks want to go,

157
00:10:58,960 --> 00:11:01,240
like, you know, modern I
is the page to begin with, So

158
00:11:01,559 --> 00:11:03,879
you know, let's let's rewrite those
set of pages to be like, you

159
00:11:03,879 --> 00:11:07,360
know, spa angular sort of style, because maybe that component style architecture makes

160
00:11:07,360 --> 00:11:11,080
a lot of sense for those pages, right, maybe it doesn't, so

161
00:11:11,279 --> 00:11:13,919
really like a page by page whatever, this system that luckily only had one

162
00:11:15,039 --> 00:11:18,720
web forms page, so it's just
like a yeah, only one of those,

163
00:11:20,240 --> 00:11:22,279
otherwise it would have been a big, you know, rewrite. But

164
00:11:22,320 --> 00:11:24,320
we had to look through everything like
what all the screens, you know,

165
00:11:24,360 --> 00:11:28,679
what, all the technology the screens
are built on, and then also all

166
00:11:28,679 --> 00:11:33,720
the behind the scenes junk like the
middleware, the any kind of back end

167
00:11:33,960 --> 00:11:37,120
whatever junk that was going on as
well. Now, did you have any

168
00:11:37,159 --> 00:11:39,600
maintainers of the four point eight version, like was it compilable or was it

169
00:11:39,639 --> 00:11:43,559
a you know, maintaining state at
least? Oh? Yeah, so this

170
00:11:43,679 --> 00:11:46,279
was like a live app that was
still having ongoing feature development too. So

171
00:11:46,480 --> 00:11:50,240
we as part of the migration process, we do we do worry about well,

172
00:11:50,279 --> 00:11:54,840
we we can't ask the business to
stop feature development for months at a

173
00:11:54,840 --> 00:11:58,600
time. Why we'll do this migration
process like that. That conversation never goes

174
00:11:58,600 --> 00:12:03,799
well, yeah, right, we
stop doing things you care about for things

175
00:12:03,799 --> 00:12:07,519
that we need and you no doubt, when you're doing this migration you you

176
00:12:07,639 --> 00:12:11,200
uncover some technical debt that you may
or may not have known was there,

177
00:12:11,639 --> 00:12:16,080
right, and invariably happens. Oh
absolutely, So that was a big thing

178
00:12:16,080 --> 00:12:20,240
for us to just we're gonna We're
gonna turn over some rocks and see it

179
00:12:20,639 --> 00:12:22,720
see something we don't want to,
we don't expect, and like do we

180
00:12:22,799 --> 00:12:24,840
just you know, turn the rock
over again and be like w ooops,

181
00:12:24,919 --> 00:12:31,559
let's just uh we try to or
do we do we try to like fix

182
00:12:31,639 --> 00:12:33,080
it? You know, why does
this class exist? And why do we

183
00:12:33,159 --> 00:12:39,080
keep passing it around? What is
that? Yeah? There was Gordon Ramsey

184
00:12:39,120 --> 00:12:45,879
going into your walk in you know
you're like, what is that? Yeah?

185
00:12:45,919 --> 00:12:48,799
I mean you we have cases where
so one big thing we did at

186
00:12:48,759 --> 00:12:52,480
the beginning was just analyze dependencies,
like what does this application depend on?

187
00:12:52,000 --> 00:12:56,559
And do those things exist and are
supported in dot net core? And for

188
00:12:56,720 --> 00:13:00,759
several of those things they didn't,
So we said, do you know,

189
00:13:00,840 --> 00:13:03,600
do we uh, you know,
there's there's kind of like shims and bridges

190
00:13:03,639 --> 00:13:07,720
that exist a don net core to
to like call APIs and donit framework and

191
00:13:07,759 --> 00:13:13,799
like cross your fingers hope they exist. But that's just a I didn't like

192
00:13:13,840 --> 00:13:16,840
that because you only know if it's
going to work at run time, and

193
00:13:16,879 --> 00:13:18,519
we didn't want to know if we
failed or not to like, oh we

194
00:13:18,600 --> 00:13:22,240
tried to call this method, it
doesn't actually exist. So we're just going

195
00:13:22,320 --> 00:13:24,519
to blow up and a user see
that. So as much as possible,

196
00:13:24,519 --> 00:13:30,399
we said, well, let's go
ahead and upgrade those things in place in

197
00:13:30,440 --> 00:13:35,039
the donet framework gap and then we've
got a straightforward migration path over to the

198
00:13:35,039 --> 00:13:39,519
dot net core for those things.
Did you use any like migration advisor tools

199
00:13:39,559 --> 00:13:43,000
anything like that. There are a
couple of those out there. There's one

200
00:13:45,159 --> 00:13:50,000
that Microsoft had out there to uh, to analyze your dependencies and kind of

201
00:13:50,000 --> 00:13:52,320
tell you, but it spit out
a list of items. I was like

202
00:13:52,639 --> 00:13:56,120
a spreadsheet with ten thousand rows to
try to shift through this. If I

203
00:13:56,399 --> 00:14:00,000
to take that much time, I'm
going to do it myself. Yeah,

204
00:14:00,039 --> 00:14:01,799
that's basically went through. It's like, well, we know what we what

205
00:14:01,840 --> 00:14:05,320
we're looking for here, so we'll
just go through and find those things.

206
00:14:05,360 --> 00:14:09,039
So one good example is like e
F six. This app used e F

207
00:14:09,120 --> 00:14:15,240
six. E F six wasn't supported
in don net core for a very long

208
00:14:15,279 --> 00:14:18,879
time, and then eventually Microsoft said, this is a big hurdle for people

209
00:14:18,919 --> 00:14:24,120
migrating, so we're going to release
another version whose sole purpose is to you

210
00:14:24,159 --> 00:14:26,200
know, cover the ninety nine percent
of the features and support it on net

211
00:14:26,200 --> 00:14:30,399
core. So that it's easier to
upgrade. So that was one like okay,

212
00:14:30,399 --> 00:14:35,159
we just we go from six six
one to six' five. Okay,

213
00:14:35,159 --> 00:14:37,960
now we get an opragrade path and
we're not going to replace with ef

214
00:14:37,000 --> 00:14:41,519
core because that is a big undertaking. Right, So that there is a

215
00:14:41,559 --> 00:14:46,600
friendly version of ef now in six' five that makes that problem go away,

216
00:14:46,639 --> 00:14:48,320
so you don't have to tear everything
apart. Yeah, and so just

217
00:14:48,399 --> 00:14:52,159
we we know we want upgrade eve
core, but it lets us not have

218
00:14:52,200 --> 00:14:56,679
to do everything all at once.
That's where we're trying to make very small

219
00:14:56,720 --> 00:15:00,960
incremental changes and we can still release
to production every time to make this change.

220
00:15:01,039 --> 00:15:03,159
Well, and the implication here is
like, don't do the bridging back

221
00:15:03,200 --> 00:15:07,840
to four eight. That's bad,
but do take advantage of the Entity Framework

222
00:15:07,879 --> 00:15:11,480
interim state because that's good. That's
that'll be all right. It's a it's

223
00:15:11,480 --> 00:15:16,039
a it's a shorter migration path because
really we want to get a dot net

224
00:15:16,080 --> 00:15:20,600
core that was the big thing dot
net six seven eight, and then once

225
00:15:20,600 --> 00:15:22,200
we were there, we could say, okay, let's go ahead and modernize

226
00:15:22,240 --> 00:15:28,200
these other pieces that have better things
or better ways of doing things in the

227
00:15:28,240 --> 00:15:33,200
dot net seven eight space, right, and I mean, and then I

228
00:15:33,200 --> 00:15:35,919
guess I begs that our early question, which is why are we doing this?

229
00:15:35,080 --> 00:15:39,600
What are we getting for it?
What is wrong with four eight?

230
00:15:39,720 --> 00:15:46,799
Right? For this client though,
they're they're big thing was like they wanted

231
00:15:46,840 --> 00:15:50,399
to take advantage of things in a
sp net core as the framework, right,

232
00:15:50,440 --> 00:15:54,039
and so this application being built on
that and being built on a st

233
00:15:54,080 --> 00:15:58,960
four for eight, they saw that, well, that's really not getting up

234
00:16:00,080 --> 00:16:03,440
dated or improved, and so this
application is going to live on in the

235
00:16:03,480 --> 00:16:07,840
future, then we want to be
on top of a framework. So it's

236
00:16:07,879 --> 00:16:11,840
less about dot at eight and more
about asp net core, as this is

237
00:16:11,879 --> 00:16:15,320
a web application that needs to live
for another ten years and grow and improve

238
00:16:15,360 --> 00:16:18,399
and change. Right, The question
is would have been better to wait longer?

239
00:16:18,559 --> 00:16:22,919
Like you were obviously not jumping on
the earliest versions of VSP dot net

240
00:16:22,960 --> 00:16:26,320
core, which were rough, but
you've got a mature versions, Like when's

241
00:16:26,360 --> 00:16:33,039
the right time to jump those new
features? Yeah? So for this application

242
00:16:33,080 --> 00:16:37,799
of particular, and the most of
them, I see, dot net six

243
00:16:37,879 --> 00:16:41,279
and seven was the right time for
them, right, And the reason why

244
00:16:41,480 --> 00:16:48,480
is that Microsoft introduced a few set
of libraries and tools to make that migration

245
00:16:48,039 --> 00:16:56,080
incrementally eight thousand times easier. Before
that, if you wanted to migrate incrementally,

246
00:16:56,559 --> 00:17:00,960
it was a very manual process to
do so. And I can kind

247
00:17:00,960 --> 00:17:03,039
of walk through what we used to
do, what we used to do for

248
00:17:03,119 --> 00:17:07,720
the dot net Core three one,
for example, we we didn't want to

249
00:17:07,720 --> 00:17:10,640
have a big bang migration, never
want to do that. That's just fraught

250
00:17:10,640 --> 00:17:12,799
with risk. The flip and the
switch is just you know, how do

251
00:17:12,799 --> 00:17:18,119
you how do you uh do regression
testing of a whole system? Every that's

252
00:17:18,119 --> 00:17:25,680
just like sucks more than flipping that
switch, is flipping it back. Well,

253
00:17:25,839 --> 00:17:27,519
we we we did do that.
We yeah, So we wanted to

254
00:17:27,559 --> 00:17:30,599
say there's no there's no roll back, there's only a roll forward. You

255
00:17:30,720 --> 00:17:34,200
fix things and incimently go. So
in the old days when we did this

256
00:17:34,319 --> 00:17:37,799
and dont Core three, one way
we would do this is we'd have two

257
00:17:37,839 --> 00:17:41,720
apps. One is your dot net
core app, one is a dot net

258
00:17:41,720 --> 00:17:45,000
framework app, right, and then
we would manually migrate pages from dot net

259
00:17:45,039 --> 00:17:51,079
framework over to dot net Core.
But from the kind of end user perspective,

260
00:17:51,119 --> 00:17:55,279
they'd still be hitting don net framework
even if this pages still the new

261
00:17:55,319 --> 00:17:59,559
pages exist in don a Core.
So we would introduce a reverse proxy in

262
00:17:59,599 --> 00:18:03,599
front of both of those apps Engine
X or something like that, where we'd

263
00:18:03,599 --> 00:18:07,759
say, oh, this sprints,
We've migrated these pages and so these pages,

264
00:18:07,799 --> 00:18:11,079
so now go over to the new
system that do not dyn ae core

265
00:18:11,079 --> 00:18:14,960
app and the old pages go over
there. So it was a very much

266
00:18:15,000 --> 00:18:18,519
a you know, very manual process
to be able to do all these sort

267
00:18:18,559 --> 00:18:22,319
of things. But starting with done
at six, Microsoft introduced a set of

268
00:18:22,359 --> 00:18:30,559
tools to make that automatic switching between
applications seamless and transparent and so much easier.

269
00:18:30,759 --> 00:18:36,000
Yeah, now do you share the
state with those two? Oh things?

270
00:18:36,079 --> 00:18:41,240
Just that must be a bear.
Okay, well let me explain first

271
00:18:41,400 --> 00:18:45,400
the way that that's automatic switching works. It's it's wild. So I have

272
00:18:45,480 --> 00:18:51,599
you all had folks talk about YARP
before, yet another reverse products So yeah,

273
00:18:51,759 --> 00:18:55,599
I think maybe Mark Rendel talked about
it a little bit, but I

274
00:18:55,599 --> 00:18:57,519
don't remember. Yeah, that makes
sense because he has a tool as well

275
00:18:57,519 --> 00:19:02,680
to make this migration easer. So
YARP is yet another reverse proxy, and

276
00:19:02,839 --> 00:19:07,000
it's a reverse proxy that can be
hosted in the asp net core pipeline.

277
00:19:07,440 --> 00:19:10,599
So it's kind of cool. So
you can actually self host a reverse proxy

278
00:19:11,559 --> 00:19:15,720
and that's exactly what this tooling does. It's the the name is kind of

279
00:19:15,480 --> 00:19:18,799
strange, but its system Web adapters
is the name of it. But the

280
00:19:18,839 --> 00:19:25,279
idea is that you have a new
asp net core application and that hosts a

281
00:19:25,400 --> 00:19:32,960
reverse proxy and request will come in
initially to your dot asp net core application,

282
00:19:33,880 --> 00:19:40,240
and if that application cannot handle that
request successfully, like the controller doesn't

283
00:19:40,279 --> 00:19:45,200
exist, it will automatically forward that
request over to your asp net full framework

284
00:19:45,240 --> 00:19:52,160
application. So if I migrate a
controller from four eight to asp net Core,

285
00:19:52,440 --> 00:19:56,039
well suddenly that application can handle that
request and is going to serve it

286
00:19:56,160 --> 00:20:00,240
up. But if the can't,
the controller is missing, just seamlessly forwards

287
00:20:00,279 --> 00:20:06,200
that request and serves the response out
over to Yeah, so it still serves

288
00:20:06,200 --> 00:20:08,960
a response through the aspnt core application, but it's just proxy. We're doing

289
00:20:10,039 --> 00:20:14,279
reverse proxy to your full framework application. So I guess what I'm getting at

290
00:20:14,359 --> 00:20:18,519
is there's no real shared state except
for you know, data persistence or whatever

291
00:20:18,759 --> 00:20:26,680
that exists between those two things.
Is there because they're completely different. Well,

292
00:20:26,799 --> 00:20:30,599
okay, so there's going there has
to be some shared states, so

293
00:20:30,640 --> 00:20:34,119
things like authentication. Yeah, both
applications have to know that you're logged in

294
00:20:34,279 --> 00:20:40,799
right, So really, depending on
your authentication scheme, you have to decide

295
00:20:40,960 --> 00:20:42,920
how are you going to share that
state. So if you're in an external

296
00:20:44,039 --> 00:20:48,559
sso then you just configure those applications
to be able to read that token effectively.

297
00:20:48,880 --> 00:20:51,799
That's not a big game. Yeah, they both have rights to that

298
00:20:51,880 --> 00:20:55,319
token. We weren't doing SS.
We were doing cookie off that was self

299
00:20:55,319 --> 00:21:03,160
hosted A yeah, yeah, yeah, so you've ever had to do effective

300
00:21:03,319 --> 00:21:06,920
well how do I do do you
do SSO with cookies? Do you have

301
00:21:07,000 --> 00:21:10,480
both applications to be able to read
the data protection certificate and be able to

302
00:21:10,519 --> 00:21:12,519
be able to read that cookie?
So that that is actually the way we

303
00:21:12,559 --> 00:21:17,279
went was like, well, we
have access to that data protection certificate,

304
00:21:17,720 --> 00:21:22,240
so what we'll do is have they're
I mean they're both initially hosted on the

305
00:21:22,279 --> 00:21:26,319
same machine, Like they're just two
I S Web applications self hosted, so

306
00:21:26,319 --> 00:21:30,960
they both had access to the certificates. So we said, okay, the

307
00:21:30,200 --> 00:21:34,400
dot net framework application is going to
continue to do the log in and log

308
00:21:34,440 --> 00:21:38,880
out and set the cookie, and
then the dot net core application is then

309
00:21:38,920 --> 00:21:44,720
able to read that cookie and be
able to set the principal roles all that

310
00:21:44,759 --> 00:21:48,799
sort of junk, and so that
just worked fine that it could read the

311
00:21:48,839 --> 00:21:52,519
information and effectively you're you're putting a
flag in the ground that says, here's

312
00:21:52,559 --> 00:21:57,240
our cut across is when we're going
to change the dot net framework app to

313
00:21:57,680 --> 00:22:03,839
give up authentication. But for now, yeah, that was actually the last

314
00:22:03,839 --> 00:22:07,079
thing we change, was like,
the very last thing we migrated was loging.

315
00:22:07,200 --> 00:22:08,880
Okay, now now we have to
worry about how do we share you

316
00:22:08,920 --> 00:22:17,599
know, all that sort of stuff
next with session session states, so we

317
00:22:17,599 --> 00:22:21,119
we I mean, that's another shared
state that the dot net core application has

318
00:22:21,160 --> 00:22:23,920
to read and write session. The
donet framework application has to read and write

319
00:22:23,920 --> 00:22:27,000
session. So how do you share
those two? How do you share that

320
00:22:27,039 --> 00:22:36,119
sort of shared state? Now,
unfortunately, this sequel schema of session is

321
00:22:36,119 --> 00:22:37,839
not the same on both sides,
So it's not like you can say,

322
00:22:38,200 --> 00:22:42,279
well, I'm already doing a web
farm scenario on donint framework that uses seql

323
00:22:42,359 --> 00:22:47,519
as of backing storage. Those schemas
are completely different, so they can't read

324
00:22:47,519 --> 00:22:51,359
and write the same like sort of
back end database of session states. Of

325
00:22:51,440 --> 00:22:56,960
course, so what the system web
adapters does is for any kind of sort

326
00:22:56,960 --> 00:23:00,839
of shared state that you have between
those two and session is just one example

327
00:23:00,880 --> 00:23:07,319
of that is the system web adapters
will expose an API indpoint in the Dinet

328
00:23:07,319 --> 00:23:11,799
framework application via middleware like o in
or whatever, and then when the Donet

329
00:23:11,880 --> 00:23:15,440
core application needs to, like,
oh, I need to read sessions state

330
00:23:15,559 --> 00:23:19,119
instead of reading its own thing,
it will make a API call to get

331
00:23:19,160 --> 00:23:23,400
that stuff from the Dinat framework application. And then you just have these like

332
00:23:23,480 --> 00:23:27,359
interface adapters that you're talking to to
get that data out. But all like

333
00:23:27,400 --> 00:23:30,279
the that makes sense, all the
API stuff, like if there's an API

334
00:23:30,359 --> 00:23:36,240
token, apikey thing to secure it, it's not exposed to the outside world

335
00:23:36,279 --> 00:23:41,759
all that sort of junk, but
it's now just exposing quote just exposing APIs

336
00:23:41,880 --> 00:23:44,480
to be able to get that sort
of data back out. Again. What's

337
00:23:44,559 --> 00:23:48,559
kind of funny and ironic about this
scenario is that all the things that Microsoft

338
00:23:48,559 --> 00:23:56,680
has done in aspn AT to make
it easier for development now becomes like a

339
00:23:56,839 --> 00:24:00,200
problem when you're trying to have two
of these things exists at the same time

340
00:24:00,319 --> 00:24:04,960
sharing state, right, I mean
like session state, the session bag,

341
00:24:06,119 --> 00:24:10,720
you know, the application bag.
All that stuff makes it easy for developers.

342
00:24:10,759 --> 00:24:18,480
It's like boom on one system.
But now that that simplicity that was

343
00:24:18,759 --> 00:24:22,960
you know, making it easy is
now hard. Yeah exactly. But luckily,

344
00:24:23,000 --> 00:24:26,839
like they they recognize that and they've
offered up solutions to be able to

345
00:24:26,880 --> 00:24:33,400
do so. But not everything had
a solution available for us. So a

346
00:24:33,400 --> 00:24:37,400
good example is like shared code,
like how do you share code between these

347
00:24:37,440 --> 00:24:44,240
two applications and so for that stuff? Yeah exactly, So we pull things

348
00:24:44,319 --> 00:24:48,119
up into a shared library that is
now you know, dot net standard probably

349
00:24:48,200 --> 00:24:52,839
so that both can can be able
to use it. And so for business

350
00:24:52,839 --> 00:24:56,319
logic that's pretty straightforward to do.
For U I logic, there is no

351
00:24:56,440 --> 00:25:00,440
sharing. Like we had a lot
of copy paste, like any kind of

352
00:25:02,759 --> 00:25:07,039
razor helper, things like those APIs
are just different. We had a lot

353
00:25:07,039 --> 00:25:12,240
of controller library like based controller classes. Those are just different name spaces.

354
00:25:12,279 --> 00:25:15,359
We can't share those, so we
just copy paste whatever. Are these that

355
00:25:15,720 --> 00:25:18,240
much different for people actually using them? If the names are different, who

356
00:25:18,319 --> 00:25:22,440
cares? But is it hard to
keep both in your head? No?

357
00:25:22,519 --> 00:25:26,359
No, Luckily, Like from the
application developer perspective, it's really just changing

358
00:25:26,440 --> 00:25:30,519
name spaces. Like there's slight you
know, there's ie action results versus action

359
00:25:30,640 --> 00:25:33,920
results. That's very little. But
from like you could blink at it and

360
00:25:34,000 --> 00:25:37,880
be like, well that's almost the
same. But there were like actual missing

361
00:25:37,880 --> 00:25:45,039
features an aspn at core from from
aspn at four or five, and a

362
00:25:45,079 --> 00:25:48,160
good example that was bundling and menification. That is not a thing that exists

363
00:25:48,240 --> 00:25:52,119
an aspnt core. That does exist
an asp dot net and it will never

364
00:25:52,160 --> 00:25:56,720
exist an aspn at core. Like
they're they're not any bundling and menification business.

365
00:25:56,119 --> 00:26:00,279
Like before Microsoft was like yes there
are are like node ways of doing

366
00:26:00,279 --> 00:26:03,319
this, but you know, we'll
provide a way of doing it. Now

367
00:26:03,319 --> 00:26:07,000
today they're like, uh, this
is a solved problem, but solved by

368
00:26:07,039 --> 00:26:10,039
not us, So use that thing. And like I said, this is

369
00:26:10,039 --> 00:26:12,400
a solved problem, Like why would
they build their own, right? You

370
00:26:12,480 --> 00:26:15,400
just go out and get the best
one you can, don't You don't need

371
00:26:15,440 --> 00:26:18,319
to make another one, just another
thing to support. And we so we

372
00:26:18,359 --> 00:26:22,119
looked at that. So anytime we
hit these sort of things that there is

373
00:26:22,200 --> 00:26:26,880
no direct migration path, we have
to decide what is that target and state

374
00:26:26,880 --> 00:26:30,039
that we want to get to.
So bundling and menification was an example that

375
00:26:30,519 --> 00:26:34,000
Okay, yes there are there are
like there are people that solve this problem,

376
00:26:34,079 --> 00:26:37,400
but they're all in the node world. Yeah, And so we had

377
00:26:37,400 --> 00:26:41,240
asked ourselves, Okay, do we
want to introduce this other build and asset

378
00:26:41,319 --> 00:26:47,079
pipeline that is totally different than what
we have today or is there something else

379
00:26:47,079 --> 00:26:51,279
can have broadcha gap. So we
actually went with a tool called web Optimizer,

380
00:26:51,680 --> 00:26:56,960
which is very similar to the asp
dot net for eight bundling of medification

381
00:26:56,119 --> 00:26:59,960
but for acep net core. Okay, so if you have very simple bundler

382
00:27:00,079 --> 00:27:03,240
and menification needs, that can do
the trick. So we saw that like,

383
00:27:03,279 --> 00:27:07,319
well, okay, maybe the right
answer eventually is to use a true

384
00:27:07,359 --> 00:27:11,960
bundling and menification pipeline, but for
now, let's just kind of go easy

385
00:27:12,000 --> 00:27:17,599
mode and do something that is solving
the problem in a very similar way than

386
00:27:17,680 --> 00:27:21,799
what existed on a HPNT four eight. Again, it sounds like in a

387
00:27:21,839 --> 00:27:26,359
later version we can optimize us further, but for now there is menification and

388
00:27:26,440 --> 00:27:30,519
bundling in a pipeline, so close
enough exactly. And we saw that the

389
00:27:30,559 --> 00:27:34,359
node pipelines would force us to even
structure all of our assets differently. Wow,

390
00:27:34,480 --> 00:27:38,160
So we thought, okay, like
it won't be exactly the same.

391
00:27:38,200 --> 00:27:41,279
So we even did tricks like in
visual studio you can you know, right

392
00:27:41,319 --> 00:27:47,039
click files and say add as link, so the file actually exists in one

393
00:27:47,039 --> 00:27:48,920
place on disc. And so we
did that a lot for these sort of

394
00:27:49,000 --> 00:27:53,880
static assets that would we would automatically
add all these folders as as links,

395
00:27:55,359 --> 00:27:59,000
so that the file existed in one
place on disc, but had to be

396
00:27:59,039 --> 00:28:03,440
structured maybe slightly differently on either side. Yeah, it's very cool. Yeah,

397
00:28:03,480 --> 00:28:07,640
that's really interesting. But and he
also speaks to there are different philosophies

398
00:28:07,640 --> 00:28:11,400
of software development, and you know, don't be too wound up about it,

399
00:28:11,440 --> 00:28:14,759
like that's okay. Just if you're
going to change philosophies, you have

400
00:28:14,799 --> 00:28:17,240
to learn a bunch of stuff.
It was all those sort of like micro

401
00:28:17,359 --> 00:28:22,519
architecture decisions of okay, what is
the shortest path to get us to production

402
00:28:23,000 --> 00:28:26,640
versus where do you want to go? And is the eventual in state on

403
00:28:26,839 --> 00:28:30,759
the way to get us in getting
us to production now? And if not,

404
00:28:30,920 --> 00:28:33,799
okay, then we have to make
a decision do we take that chance

405
00:28:33,880 --> 00:28:37,920
now or do we just you know, go sidestep a little bit and say

406
00:28:37,160 --> 00:28:40,480
let's just get something that can work
for now, because our end goal is

407
00:28:40,480 --> 00:28:44,799
to have the whole app and production
on Dot eight and Jimmy, I got

408
00:28:44,839 --> 00:28:52,039
a break for one moment for those
very important message and we're back. It's

409
00:28:52,119 --> 00:28:56,440
Dona Rock's Amerchard Campbell. That's Carl
Franklin Hey recording in twenty twenty four.

410
00:28:56,440 --> 00:28:59,519
Who would have thunk it? Who
thunk? And we're here with our friend

411
00:28:59,559 --> 00:29:03,440
Jimmy but Guard talking a bit about
his experiences migrating a dot net app,

412
00:29:03,759 --> 00:29:07,640
a framework app, a four point
eight app up to dot net core.

413
00:29:07,160 --> 00:29:11,359
I guess originally targeting six, but
heck, here's eight, might as well

414
00:29:11,400 --> 00:29:15,400
go. There was there any real
differences between six and eight? Did you

415
00:29:15,440 --> 00:29:18,799
stop by seven on the way?
Was that a factor? So one of

416
00:29:18,839 --> 00:29:22,680
our one of my philosophies for just
getting this deployed out is I I wanted

417
00:29:22,720 --> 00:29:26,440
to get to production as early as
possible. So for us, that meant

418
00:29:26,799 --> 00:29:33,079
our very first deployment was a completely
blank dot net six app that did nothing

419
00:29:33,480 --> 00:29:37,519
but proxy straight over to the full
down that framework did. That totally makes

420
00:29:37,559 --> 00:29:41,240
sense, it does in hindsighted,
but that's that is one of those like

421
00:29:41,319 --> 00:29:45,240
okay, do do we need to
do we have something there that does anything

422
00:29:45,519 --> 00:29:53,160
or or what? And because just
getting that first dot net six app required

423
00:29:53,200 --> 00:29:56,759
us to do all the build and
deploy pipelines and I setup, like we'll

424
00:29:56,799 --> 00:30:02,400
just do that. It'll be a
like a foot hold on the beachhead and

425
00:30:02,440 --> 00:30:06,119
then we can start to build on
top of that. So that's our first

426
00:30:06,160 --> 00:30:08,359
thing out. Yeah, it's a
Hello World, right, Like you got

427
00:30:08,400 --> 00:30:11,039
to get there one way or there
going to do that. So the fact

428
00:30:11,039 --> 00:30:15,839
that you're only doing that first just
you know, cuts away the other confusion

429
00:30:15,839 --> 00:30:19,880
of well, why isn't that page
working? Is it the page or is

430
00:30:19,920 --> 00:30:26,960
it the proxy or is it the
authentication engine or is it the session issue?

431
00:30:26,960 --> 00:30:29,079
Like there's a ton of the things
that canna be wrong. Have as

432
00:30:29,119 --> 00:30:33,640
few things wrong as possible. And
the question of like which dot net version

433
00:30:33,640 --> 00:30:37,319
of target was also a challenging one
because there's a trade off between from looking

434
00:30:37,359 --> 00:30:41,720
at your dependencies what is supported on
both frameworks, because your business logic if

435
00:30:41,720 --> 00:30:47,119
it depends on a library that is
supported on both sides, it's good.

436
00:30:47,200 --> 00:30:51,200
But sometimes it's not supported to the
latest and greatest framework, so sometimes you

437
00:30:51,200 --> 00:30:55,839
have to upgrade to an earlier version
and then migrate up with upwards from there.

438
00:30:56,119 --> 00:31:00,240
So we actually had that with we
were looking at asp at seven that

439
00:31:00,359 --> 00:31:03,759
included a feature that we wanted to
use, which was output cashing. Output

440
00:31:03,759 --> 00:31:08,400
cashing was only introduced with ESPN at
seven and our system used that, so

441
00:31:08,599 --> 00:31:11,039
like, well, we want to
use that, but then our dependencies didn't

442
00:31:11,079 --> 00:31:15,519
support all the way up to there, so like, okay, do we

443
00:31:15,599 --> 00:31:18,839
just like ignore some of the pages
or nope, or maybe don't have output

444
00:31:18,880 --> 00:31:22,599
casing for now and just wait on
that until we're fully on. And then

445
00:31:22,640 --> 00:31:30,920
we introduced opput caching. We actually
found like someone at Microsoft backpowarded through this

446
00:31:30,039 --> 00:31:34,640
new get package output casing with a
label do not use this. This is

447
00:31:34,720 --> 00:31:38,240
for you know. We just found
like, well, we'll just go in.

448
00:31:38,480 --> 00:31:42,000
So it definitely is an analysis part
at the beginning to look at your

449
00:31:42,039 --> 00:31:48,680
dependencies to understand what is what is
possible for you to migrate to support both

450
00:31:48,920 --> 00:31:52,480
frameworks initially, and maybe that's just
a first step is to migrate something to

451
00:31:52,480 --> 00:31:56,480
a little bit older and then now
that you're on net core or whatever,

452
00:31:56,559 --> 00:31:59,799
then you can start to migrate upwards
from there. Well, I think I

453
00:31:59,799 --> 00:32:04,039
found out a Sebastian Ross output cashing
yep, and it's output cashing asp dot

454
00:32:04,079 --> 00:32:12,039
net core six. Warning this package
is not supported exactly, but he's definitely

455
00:32:12,039 --> 00:32:14,400
done us a favor, Right,
this is exactly what this is for.

456
00:32:14,480 --> 00:32:17,799
It's a bridge to get to six
with that feature and knowing you're as soon

457
00:32:17,799 --> 00:32:21,720
as possible, you're going to move
to Sabbath. Sapic cashing was one of

458
00:32:21,759 --> 00:32:24,400
those things like it is it is
kind of shared state, but not really

459
00:32:24,880 --> 00:32:30,759
like if the two applications have two
caches with the same data, you know

460
00:32:30,000 --> 00:32:35,440
whatever, Like that's good enough.
Yeah, it's not shared. It is

461
00:32:35,519 --> 00:32:38,720
persistent, but it's not shared across
pages, so really session state. And

462
00:32:38,759 --> 00:32:43,680
then the next thing we hit was
hang fire. That was another big hurdle

463
00:32:43,720 --> 00:32:46,519
for us was to get hang fire
being able to be used on both sides.

464
00:32:46,759 --> 00:32:50,559
So what's hang fire? Yeah,
what is that? Oh? Hang

465
00:32:50,680 --> 00:32:57,599
fire is a it's a the background
task runner for ASP dot net and ASP

466
00:32:57,680 --> 00:33:01,440
dot net core. And in terms
of uh background tasks, it's not like

467
00:33:01,559 --> 00:33:06,640
thread dot start or thread dot run. It's persistent, so it's able to

468
00:33:07,200 --> 00:33:12,160
effectively have like a like a queuing
capability or state capturing capability. So if

469
00:33:12,160 --> 00:33:15,240
I want to say, send this
email, but don't send it now,

470
00:33:15,599 --> 00:33:19,039
send it you know in a background
whatever, but something they can actually be

471
00:33:19,119 --> 00:33:22,759
retried and like remembered. So hang
fire is a library that lets you do

472
00:33:22,799 --> 00:33:27,519
that also does things like scheduled jobs
to so like it's cron but it's all

473
00:33:27,839 --> 00:33:31,079
it's all self hosted inside asp dot
net and asp dot i core. And

474
00:33:31,119 --> 00:33:34,960
if you haven't had the hang fire
folks on to talk to them, that's

475
00:33:34,960 --> 00:33:39,519
a that's a fantastic library if you
want to do like async background tasks in

476
00:33:39,559 --> 00:33:44,480
a more robust manner. Nice so
noted. So one of the challenging things

477
00:33:44,559 --> 00:33:50,039
is and hang fire you you can
define cues of work to say go go

478
00:33:50,119 --> 00:33:53,000
do this work sometime in the future, and then it supports all sorts of

479
00:33:53,079 --> 00:33:58,440
cuing mechanisms, including sql uh.
One of the cool things that does,

480
00:33:58,440 --> 00:34:01,960
though, is you can say I'm
in my controller class and I say go

481
00:34:02,000 --> 00:34:05,519
do this work. But the work
you're saying to do is to call this

482
00:34:05,599 --> 00:34:08,639
function that's also inside the controller class. So it's very easy to say,

483
00:34:09,199 --> 00:34:13,559
you know, just extract out a
method and say just call this one method,

484
00:34:13,599 --> 00:34:16,039
but call it, you know,
call it offline in the background.

485
00:34:16,960 --> 00:34:21,039
So it's just a more robust way
of doing thread dot run or whatever.

486
00:34:21,800 --> 00:34:24,360
But it's it's able to keep it, keep track of it. The way

487
00:34:24,360 --> 00:34:29,079
it does this though, is it
notes the class and type of the method

488
00:34:29,119 --> 00:34:31,360
that you want to run and then
also captures the state you pass into it

489
00:34:31,559 --> 00:34:36,960
and like some blob to be able
to use reflection to load it up and

490
00:34:36,960 --> 00:34:42,239
then call it. But that implies
that that the thing that is going to

491
00:34:42,519 --> 00:34:45,880
sort of DQ and start the work
has to have access to that class and

492
00:34:45,920 --> 00:34:50,880
that type, and it's not something
that's completely obvious unless you understand the internals

493
00:34:50,920 --> 00:34:54,440
of this hand fire system. So
we realize that, Okay, if I

494
00:34:57,079 --> 00:35:01,000
try to start the job on the
ASPNT four or five side and I try

495
00:35:01,039 --> 00:35:06,360
to execute the job over on the
donet core side, it may not have

496
00:35:06,440 --> 00:35:10,599
access to that job code. So
we have to decide do I refactor these

497
00:35:10,679 --> 00:35:15,719
jobs out into my common business logic
so that both sides have access to it.

498
00:35:15,679 --> 00:35:19,000
We wind up not doing that.
We wind up doing it to say,

499
00:35:19,960 --> 00:35:23,000
we will define queues one queue for
the don net four eight side,

500
00:35:23,039 --> 00:35:27,039
one queue for the dot net core
side or dont six seven eight side,

501
00:35:27,400 --> 00:35:31,719
and then when I need to n
Q a job, the on qu or

502
00:35:31,760 --> 00:35:36,480
has to know where does that code
live. Does it live on the dot

503
00:35:36,559 --> 00:35:38,559
net eight side or does it live
on the donet four five side, and

504
00:35:38,639 --> 00:35:42,719
what they let us do is just
say, for the don net four five

505
00:35:42,800 --> 00:35:49,840
side, we will que it can
it can, it can exit. It

506
00:35:49,880 --> 00:35:53,039
can start and run jobs on its
side, same side on the donat eight

507
00:35:53,079 --> 00:35:55,559
side, it can start and run
jobs, and vice versa. So I

508
00:35:55,599 --> 00:36:00,960
can have dot net four eight kickoff
jobs, dot net core and dot net

509
00:36:00,960 --> 00:36:06,119
core kickoff jobs and four eight depending
where that job logic actually lived. And

510
00:36:06,159 --> 00:36:09,039
so over time we over to migrate
those jobs over to dot nets eight,

511
00:36:09,480 --> 00:36:14,639
but along the way not sort of
force ourselves to have to refacture all that

512
00:36:14,719 --> 00:36:16,519
job logic, because it was it
was pretty complicated, and we said,

513
00:36:16,760 --> 00:36:20,320
it's going to be too much work
to try to pull all this stuff out

514
00:36:20,760 --> 00:36:25,039
do some common location when today there
were just private methods on a controller class.

515
00:36:25,400 --> 00:36:28,599
It'd be a lot of work to
try to pull those out to somewhere

516
00:36:28,599 --> 00:36:30,920
else. And we realized like there
were there's a lot of work to win

517
00:36:30,960 --> 00:36:36,440
into getting those things hooked up appropriately. But just another one of those things

518
00:36:36,440 --> 00:36:42,480
that I have shared states, shared
kind of background resources between these two systems,

519
00:36:42,880 --> 00:36:45,599
and I have to figure out how
do I effectively get these two systems

520
00:36:45,639 --> 00:36:50,280
to kind of play nice with each
other over time. Yeah, and this

521
00:36:50,440 --> 00:36:52,320
is all part of that bridge.
But and you did get to the full

522
00:36:52,360 --> 00:36:54,880
cut across. Like you said,
you get to a point where you've replaced

523
00:36:54,920 --> 00:37:00,440
everything, like how many how many
deployees? Is that? How many interimsps?

524
00:37:00,039 --> 00:37:04,840
You know? Well, so the
organization that I was working with was

525
00:37:04,840 --> 00:37:07,360
doing weekly deploys, and so we
wanted to keep to that, like every

526
00:37:07,440 --> 00:37:09,960
week we would deploy the pages and
we have migrated all the way out to

527
00:37:10,000 --> 00:37:15,000
production. We just didn't want to
have this big bang. Okay, now

528
00:37:15,039 --> 00:37:16,480
all the pages are over, Now
it's time to cut over. There was

529
00:37:16,519 --> 00:37:22,840
no cutover. It was just a
slow, slowly like constricting it down and

530
00:37:22,880 --> 00:37:28,800
down and down until the very end. I guess I didn't talk about migrating

531
00:37:28,800 --> 00:37:31,320
individual pages, but that was pretty
straightforward. You basically copy and paste the

532
00:37:31,320 --> 00:37:36,920
code and fix the compile errors.
If the dependencies weren't working, well you

533
00:37:37,360 --> 00:37:39,679
go pull in those dependencies. And
then if those dependencies had to be hooked

534
00:37:39,719 --> 00:37:43,920
up via dependency injection, well,
now we go ahead and can figure the

535
00:37:44,039 --> 00:37:47,840
new DEI container to wire up all
those dependencies. So it's very much incremental,

536
00:37:47,920 --> 00:37:52,000
just pull things over as we went
and then if we saw extra problems

537
00:37:52,159 --> 00:37:55,599
cropped up, we would pull those
in, but otherwise it really was just

538
00:37:55,639 --> 00:38:02,800
like fixing namespace errors and copying and
pasting UI code. But we would deploy

539
00:38:02,880 --> 00:38:07,199
every week the new controllers and pages
that had been pulled over, and even

540
00:38:07,239 --> 00:38:12,840
our stories inside of Jira were every
story was migrate this controller. Right,

541
00:38:12,960 --> 00:38:17,400
so we knew we had a clear
sort of burned down, which is one

542
00:38:17,440 --> 00:38:22,599
controller at a time, just kind
of steadily chopping them, chopping away at

543
00:38:22,599 --> 00:38:25,000
it, until eventually there were no
more controllers left, and the only thing

544
00:38:25,000 --> 00:38:29,519
we had was an empty an empty
application that was still deployed all the way

545
00:38:29,559 --> 00:38:32,079
to production, right, but nothing
in it. Well, yeah except for

546
00:38:32,119 --> 00:38:36,679
the olag and controller, like the
authentication that was the last one. Except

547
00:38:36,679 --> 00:38:39,559
the log and controller, of course. Yeah, And that's fair. I

548
00:38:39,599 --> 00:38:44,719
wonder if you sort of nailed down
all the hard bits early, like took

549
00:38:44,800 --> 00:38:46,639
spikes on stuff like output, cash
you and so forth, or did you

550
00:38:46,800 --> 00:38:50,679
find a few as you work through
some of these controllers you're like, oh,

551
00:38:50,719 --> 00:38:52,920
how are we going to do this? We had, so we tried

552
00:38:52,920 --> 00:38:58,320
to get a decent idea up front
of cataloging, and it's pretty easy to

553
00:38:58,320 --> 00:39:00,000
do, like you go to the
global asax right, look at your middleware,

554
00:39:00,039 --> 00:39:04,000
that being what is being pulled in
there this application. I was using

555
00:39:04,039 --> 00:39:06,880
Owen, so we looked at Owen
startup and of course webcinfig right, because

556
00:39:06,880 --> 00:39:08,800
there's so much junk in there.
We just looked at Okay, all these

557
00:39:08,800 --> 00:39:14,840
things have features that exist an asp
net core more or less. So what

558
00:39:14,960 --> 00:39:16,280
is the sort of migration path?
Well, we knew we were going to

559
00:39:16,320 --> 00:39:20,000
get it all. So one example
is hang fire. We hit that like,

560
00:39:20,119 --> 00:39:22,800
oh right, we get an error
running the job. It's because it

561
00:39:22,880 --> 00:39:25,400
can't run the job. The job
is over there, not over here,

562
00:39:25,920 --> 00:39:29,360
So we'd have to do you know, okay, let's pause, do a

563
00:39:29,400 --> 00:39:34,719
spike, and then we wind up
doing things like well, let's defer.

564
00:39:35,280 --> 00:39:38,039
Once we found that that was an
issue just prioritization, we deferred all of

565
00:39:38,079 --> 00:39:42,000
the controllers that did that to say, let's just do them later because we

566
00:39:42,039 --> 00:39:44,480
need to figure this out first and
work on some other ones that don't have

567
00:39:44,559 --> 00:39:47,719
that sort of dependency going on there. That's that's legit, and it just

568
00:39:47,760 --> 00:39:52,840
feels normal. But I really appreciate
it about this whole conversation, Jimmy,

569
00:39:52,920 --> 00:39:57,000
is that you didn't go for the
ideal case on anything like, it's like,

570
00:39:57,039 --> 00:39:59,039
well, that will be good enough
for now. We'll be able to

571
00:39:59,039 --> 00:40:02,800
optimize that later. That'll solve that
one. This is an interim step and

572
00:40:04,079 --> 00:40:06,639
you know, and you're going to
have some glitches along the way. It

573
00:40:07,000 --> 00:40:08,920
doesn't sound like it was a perfect
migration. You had to fight through some

574
00:40:08,960 --> 00:40:13,480
stuff now. So we just made
sure that in our schedule. You know,

575
00:40:13,480 --> 00:40:15,880
we didn't try to solve all the
world's problems up front, Like the

576
00:40:15,920 --> 00:40:20,840
big spike we did up front was
just this whole YARP system of adapters because

577
00:40:21,079 --> 00:40:23,440
that had just come out like a
month before we started the project. I

578
00:40:23,440 --> 00:40:27,280
was like, oh, this is
how we can do it. That's great.

579
00:40:27,400 --> 00:40:29,559
I was a frame or easier,
but we had to figure out,

580
00:40:29,679 --> 00:40:32,440
okay, is it as easy as
we think it is? And for the

581
00:40:32,440 --> 00:40:35,760
most part it was, except for
like the shared state, you know,

582
00:40:35,800 --> 00:40:39,119
the hard problems authentication whatever, but
for the like just normal pages, like

583
00:40:39,199 --> 00:40:45,400
it was even things like signalre it
worked between those two applications. I was

584
00:40:45,480 --> 00:40:49,440
like, wow that just as long
as they can talk to protocol, that's

585
00:40:49,440 --> 00:40:52,800
how signal are supposed to work.
It was able to proxy through just fine

586
00:40:52,800 --> 00:40:58,719
to the done framework application. Right
before Christmas, I upgraded a customer's website,

587
00:40:58,760 --> 00:41:00,719
a Blazer site that I had built
and dot net six and upgraded to

588
00:41:00,800 --> 00:41:07,039
dot net eight, and that exactly
the same. I mean, most of

589
00:41:07,079 --> 00:41:12,159
the stuff just worked. There was
there's you know, the obvious things,

590
00:41:12,280 --> 00:41:15,800
you know with Blazer, there's some
big changes and stuff, and you know,

591
00:41:15,960 --> 00:41:21,559
things that come out of program cs
that were there before, things that

592
00:41:21,599 --> 00:41:24,199
go in updating all oh my god, updating all the new Gap packages.

593
00:41:25,480 --> 00:41:30,480
Yeah, that's I mean that was
the very first thing, you know,

594
00:41:30,039 --> 00:41:34,599
and then reformatting. But you know, as I said, I discovered some

595
00:41:34,719 --> 00:41:39,440
technical debt in there. This was
definitely a project that I started and started

596
00:41:39,480 --> 00:41:44,199
the customer down the road, and
then they kind of took it from there.

597
00:41:45,000 --> 00:41:49,119
And I wasn't like a babysitter on
the project, right and I'm discovering

598
00:41:49,159 --> 00:41:52,800
all sorts of weird things. They
just found ways to make stuff work that

599
00:41:52,119 --> 00:41:57,559
come with consequences. Yeah, yeah, well, just it works. It's

600
00:41:57,599 --> 00:42:01,880
great, you know, it works, but it's not great. Great.

601
00:42:01,920 --> 00:42:06,519
We definitely hit a bunch of things. It was just it had been a

602
00:42:06,519 --> 00:42:08,840
while since I've been in like deeply
involved in dot net four eight and a

603
00:42:08,920 --> 00:42:14,800
SPNT four eight. I just forgot
how many things were fixed and ASPN net

604
00:42:14,800 --> 00:42:16,840
core, so there was a there
was so much code I got to just

605
00:42:16,880 --> 00:42:22,039
delete. That was just you know, infrastructure wiring of stuff that is now

606
00:42:22,119 --> 00:42:27,119
just services dot blah. I just
it's just there and for me, so

607
00:42:27,159 --> 00:42:31,639
there's you know a bunch of filters
owen stuff that just went away and made

608
00:42:31,679 --> 00:42:36,239
me so happy. Oh the webcon
figure, Yeah, that just that was

609
00:42:36,280 --> 00:42:37,960
all code. Now it's it was. It was beautiful. It's great,

610
00:42:38,519 --> 00:42:43,960
yeah, it's it's it's profound.
But I appreciate that. The core idea

611
00:42:44,000 --> 00:42:49,119
here was no dead drop. Start
with YARP so that you have the new

612
00:42:49,199 --> 00:42:52,159
a blank new app that's just redirecting
everything to the old app. And then

613
00:42:52,599 --> 00:42:58,039
I mean my instinate would say,
now pick the least important thing and build

614
00:42:58,119 --> 00:43:01,599
it first in the new app and
see if that works like a min's screen.

615
00:43:01,960 --> 00:43:06,960
Yeah, so that was that's that's
what we wound up doing, is

616
00:43:07,000 --> 00:43:09,079
like is it was the I forget
it was, but with something the homepage

617
00:43:09,159 --> 00:43:13,519
is something that had like nothing on
it, and we knew like that.

618
00:43:13,519 --> 00:43:15,679
That first one though, took a
lot, because that meant we had to

619
00:43:15,719 --> 00:43:20,840
have styling, we had to have
layouts, we had to have all the

620
00:43:20,880 --> 00:43:23,800
dependencies hooked up. So yeah,
we picked the dumbest page possible to start

621
00:43:23,840 --> 00:43:28,159
with. Knowing that, okay,
now we got to get like all the

622
00:43:28,679 --> 00:43:35,079
all the very application company specific gumming
gum you know, to glue all together.

623
00:43:35,440 --> 00:43:37,360
That has to come along with that. So we're like, we'll just

624
00:43:37,360 --> 00:43:39,440
pick something dumb to make it simple
for the first step, because then you

625
00:43:39,559 --> 00:43:44,960
focused on those gubbins, right,
like that, the styling stuff, like

626
00:43:45,000 --> 00:43:47,079
all of that bits and pieces,
because the page is not the most party,

627
00:43:47,079 --> 00:43:51,400
it's all of that, and again
you could get lost in that complexity

628
00:43:51,440 --> 00:43:53,639
all that Ruckus, Yeah, exactly. Gubbins is a good word. I

629
00:43:53,679 --> 00:44:00,920
love that. Thank you John Skate
for introducing me to that word web gubbins.

630
00:44:00,159 --> 00:44:05,719
You know, my kids now say
ruckus. There's all that in thereat.

631
00:44:06,679 --> 00:44:12,639
It's a good word. H boy, that's it totally makes sense,

632
00:44:12,840 --> 00:44:15,920
like all of these bits and pieces
of that's the approach to go through the

633
00:44:15,280 --> 00:44:21,679
different parts and you get to a
good place eventually. So at a year,

634
00:44:21,880 --> 00:44:24,320
you figure, did you take a
year? Oh no, no,

635
00:44:24,320 --> 00:44:30,000
no, Like it was a year
of my life just dealing with several of

636
00:44:30,039 --> 00:44:31,639
their apps. So we the first
the one we migrated, was done in

637
00:44:31,679 --> 00:44:37,199
about four months, and that was
I don't know, one hundred two hundred

638
00:44:37,199 --> 00:44:42,480
controllers and maybe about five hundred actions
or so. But like, once our

639
00:44:42,480 --> 00:44:45,599
team got the hang of doing these
pages, they could just like knock them

640
00:44:45,639 --> 00:44:47,280
out. It started to just become
like a rhythm that they did the thing

641
00:44:47,360 --> 00:44:51,719
to say that you had the we
had the live you know, the living

642
00:44:51,719 --> 00:44:53,920
wiki page that would keep Okay,
if you run to X, y Z,

643
00:44:54,519 --> 00:44:59,280
here's how you solve that problem.
And then just continually have a little

644
00:44:59,280 --> 00:45:02,440
micro lessons learned as we go,
and they just started to really roll once

645
00:45:02,440 --> 00:45:05,760
we got going. Yeah, I
bet they got some momentum up, Like

646
00:45:05,840 --> 00:45:08,119
the cadence gets faster and faster as
you know where all the bits lie where

647
00:45:08,239 --> 00:45:10,480
Okay, that's how you solve this
problem. That's how you solved that problem.

648
00:45:10,599 --> 00:45:14,920
Do you get And yeah, eventually
there's not you know, not new

649
00:45:14,960 --> 00:45:16,719
problems to solve anymore. It's just
okay, we figured out all the hard

650
00:45:16,719 --> 00:45:20,599
problems. Now it's just copy paste, copy, just co go time.

651
00:45:20,760 --> 00:45:25,079
Yeah. Did are they now better
equipped to migrate something else inside the organization?

652
00:45:25,159 --> 00:45:29,559
Like I got to think this is
somewhat personal mapping to the way that

653
00:45:29,679 --> 00:45:31,960
company likes to build apps, so
that the skill set they now have is

654
00:45:31,960 --> 00:45:36,360
good for their apps, not necessarily
good for everybody else's apps. Yeah,

655
00:45:36,400 --> 00:45:38,159
So the next app was was a
lot easier because we knew we didn't have

656
00:45:38,199 --> 00:45:42,920
to prototype a lot of stuff,
Like we didn't have to prototype the yard

657
00:45:43,000 --> 00:45:45,280
stuff or or understand, well,
how do we solve the hang fire session

658
00:45:45,280 --> 00:45:47,800
problem, Like we knew how to
do that, So the heame a lot

659
00:45:47,840 --> 00:45:52,000
easier. If they had a giant
web form system, though, then like

660
00:45:52,079 --> 00:45:58,679
that's that's totally different. So if
you're like Vanilla NBC Vanilla web API,

661
00:45:59,159 --> 00:46:02,519
it's a pretty straight forward activity to
do there. I mean, there's always

662
00:46:02,519 --> 00:46:07,360
going to be things like oh gosh, they were using some controller or some

663
00:46:07,000 --> 00:46:12,519
upload control that was was not supported
anymore. It last was leaves, Like

664
00:46:12,559 --> 00:46:15,519
in twenty thirteen, I was like, Okay, for this thing, we

665
00:46:15,559 --> 00:46:17,320
need to migrate that thing first.
There's always going to be those one offs.

666
00:46:17,320 --> 00:46:21,639
But as a general approach, we
knew this was like this was the

667
00:46:21,719 --> 00:46:25,159
way to go, incremental small steps
and release as we go. So,

668
00:46:25,320 --> 00:46:29,519
Jimmy, what's next for you?
What's in your inbox on my inbox.

669
00:46:29,679 --> 00:46:34,400
Oh gosh, well it's same old, you know, same old, more

670
00:46:34,480 --> 00:46:37,920
modernization, more migrations, more more
up upgrades to folks for doing this kind

671
00:46:37,960 --> 00:46:40,920
of thing. So like I kind
of learned it once and so I want

672
00:46:40,920 --> 00:46:44,360
to help more folks be able to
do this in the future. You could

673
00:46:44,880 --> 00:46:50,320
speaking anywhere coming up. I am
albeit to NDC London this month, next

674
00:46:50,320 --> 00:46:53,719
month with all the cool kids.
Yeah yeah, I guess, and then

675
00:46:53,920 --> 00:46:58,719
I'm taking a break. Maybe maybe
I'll be at the MVP summit. I'm

676
00:46:58,760 --> 00:47:04,280
still deciding in March, take a
little break and then do some travel next

677
00:47:04,280 --> 00:47:08,000
to aprilcasts awesome, very good.
Well, it's been great talking to you

678
00:47:08,039 --> 00:47:13,800
as always, and I'm happy New
Year and we'll see you next time.

679
00:47:13,880 --> 00:47:37,679
To your listener on dot net rocks. Dot net Rocks is brought to you

680
00:47:37,719 --> 00:47:44,039
by Franklin's Net and produced by Pop
Studios, a full service audio, video

681
00:47:44,119 --> 00:47:49,039
and post production facility located physically in
New London, Connecticut, and of course

682
00:47:49,079 --> 00:47:53,719
in the cloud online at pwop dot
com. Visit our website at d O

683
00:47:53,840 --> 00:47:58,880
T N E t R O c
k S dot com for RSS feeds,

684
00:47:59,159 --> 00:48:02,840
downloads, mobile apps, comments,
and access to the full archives going back

685
00:48:02,880 --> 00:48:07,280
to show number one, recorded in
September two thousand and two. And make

686
00:48:07,320 --> 00:48:10,960
sure you check out our sponsors.
They keep us in business. Now go

687
00:48:12,000 --> 00:48:22,519
write some code. See you next
time. You got jud Middle Vans time then
