dependency-injection-dotnet-core
Hello. I know that this is an old example but it is very important to me to run this code (If you want to know why I will personally answer in DM). Anyway this is the example. https://github.com/auth0-blog/dependency-injection-dotnet-core
It mentions that the code is not meant to run, but just to support the article https://auth0.com/blog/dependency-injection-in-dotnet-core/
61 Replies
Are you just trying to learn how to do dependency injection in modern .NET?
runs just fine?
maybe be a bit more specific on what you want it to do
I am not a programmer. I is an asigment for another class that just says this:
It specificly asks this:
DI exercise for web and console based on the example in .NET6
Run DI for web and console based on the example
https://auth0.com/blog/dependency-injection-in-dotnet-core/
uh... whats the point in running a super simple example of a DI setup for a nonprogrammer? 😄
Its assigment for a class that they forced me to take thats it is about this.
only class left to finish my studies or they delete me
Tbh I find the lesson over complicated and DI isn't even correctly implemented where it actually should be.
Is straight crap in a lesson about DI.
as SG said thou, it runs just fine
i have 0 knowledge, how do I run it?
Did you download it?Does it run for both Console and Web ffolder
Also how do you run it ?
It'll compile, but you cannot run it, it's just an example.
how can i do that
also is it on .NET6 ?
No, it's on .NET Core 3.1
https://github.com/auth0-blog/dependency-injection-dotnet-core/blob/master/OrderManagementConsole/OrderManagementConsole.csproj
Examine the Tag
TargetFramework
My asigment says to do it on net 6
but it gives me this example
https://auth0.com/blog/dependency-injection-in-dotnet-core
Change the Targetframework to
net6.0
and you're fine, no big deal then.
You need a compiler to compile sourcecode into binaries.
Easiest way to get along is to install Visual Studio
which is an IDE and comes with a compiler, framework supports and all the other fancy dandy stuff.
The *.sln
files are so called Solution
, they include the Projects
, open one up with Visual Studio
, go to Build
->Build Solution
and it'll compile.
But again, you cannot run the code, it's just and example, the endpoint isn't existing.So what is the meaning of the asigment
it says
DI exercise for web and console based on the example in .NET6
Run DI for web and console based on the example
https://auth0.com/blog/dependency-injection-in-dotnet-core/
Auth0 - Blog
Understanding Dependency Injection in .NET Core
Learn what Dependency Injection and IoC are and what .NET Core provides you to support them.
do i have to make the code run some way?
thats all the asigment asks
nothing else
and of course they do not answer any question as always..
The meaning is, just a wild guess here, to teach you about
Dependency Injection
, which is definitely not the first thing you teach somebody who never wrote a single line of code ...Trust me I know
they forced me to take this subject for somee reason
my field is not a programmer but it is nessesary to do this or they will delete me
so I have 0 knowledge on this
So I will have to risk it and give them the final code
from here
but I will first have to change it to net core 6
I know you told me how to do it but can you explain to me a little bit more how I can change it?
first of all I have to download it somehow
Replace
with
in both
csproj
project files.
Click on Code
, the green button, and then Download ZIP
, easiest way if you don't have GIT
installed.you know, doing that keeps the dates on the files as 2020
someone told me that i can get it somehow with a rep method from visual studio
so the files dates are today
so it is not that obvious that i copied it and it would seem more like i followed the tutorial
Do you need to learn from that specific source? I would advise you to search for another tutorial.
not at all
all I need it to give this
DI exercise for web and console based on the example in .NET6
Run DI for web and console based on the example
and if that is whay they want i am done
i am not a programmer
its just a stupid subject they forced on me because the other subjects were full
and also its the last subject
after that I get my degree
but it is due tomorrow
if i dont give it the proffesor told me that i will be deleted
he is really awfull and i am really anxious
Technically you are, since you're programming almost everyday; programming the alarm on your clock.
The right term for people who write code is developer.
And it's not a stupid subject, it's super exciting 😄
yeah i believe so
for people of the subject
but it was forced on me
and the proffesor really threatens me
I am prety sure I know the reason
I just really need to get this done
and move on
You seem really kind
thank you for putting in time
I have no clue about it, but... follow this guy here, he explains DI in a very good way, imho, not overcomplicated, sticks to the basic and explains all the code.
https://www.youtube.com/watch?v=cCSrPZroICg
Skill Foundry
YouTube
Dependency Injection in C# ❘ A Hands-On Guide to Boosting Code Flex...
Welcome back to Skill Foundry! Today, our expert Eric Wise will demystify Dependency Injection, a must-know for any coder aiming for better code flexibility and testability. We'll kick off with an overview before diving into hands-on coding, using C# to transform a basic Rock-Paper-Scissors game through Dependency Injection. This tutorial is use...
i really dont know the basics
of programming
it is imposible to follow for me
can you help me downlaod this
change it to net 6
and compile it?
https://github.com/auth0-blog/dependency-injection-dotnet-core
I believe you, but other than that, I cannot help you.
Can't write code for you, especially if you don't know what's in there.
dont write code
its there
just help me understand how I can download it change it to net 5
net 6
and move on with my life
here
git clone -b starting-point --single-branch https://github.com/auth0-blog/dependency-injection-dotnet-core.git
i tried this
but it downloads only OrderManagementWeb folder
and not OrderManagementConsole
Because there are two branches in the repo, by
-b starting-point
you select a different branch that goes by the name starting-point
, it only includes that one folder.
Just do it simple, use git clone https://github.com/auth0-blog/dependency-injection-dotnet-core.git
in visual studio?
perfect it worked
now about change it to net 6
i changed netcoreapp3.1 to net6.0 in both csproj files
is that enough?
Do a build.
in OrderManagementConsole.csproj
Even though i change 3.1 to 6.0
i can see that here it still mentions 3.1.1
build is kind of a synonym for compile in VS.
Go to
Build
->Build Solution
do i have to change that 3.1.1 to 6.0 first?
Na, leave it, if it compiles, this is another assembly/dll/library.
do i open the sln file first?
in visual studio
yay
which of the 2?
OrderManagementConsole.sln or OrderManagement.sln ?
Both, seperatly, you gotta do it twice.
ok lets start with OrderManagement.sln
i did it
build solution
You should see an output like
1 succeeded
in the Output windownothing its empty
Also in your folders, there should be a
bin
folder, this is where the compiled binaries are stored.i see the bin yeah
and it says net 6.0
and there should be a
*.dll
, this is your binary you compiled out of the sourcecode. the final product, if you want so.
So, now you have the binaries, it's net6.0
and the sourcecode. That's pretty much it.
And if you have faith, well, pray. - Don't do your assignments last minute^^so now
i did build both
in both bin folders i see an exe
must i run it?
No
All the assigment says is this:
DI exercise for web and console based on the example in .NET6
Run DI for web and console based on the example
https://auth0.com/blog/dependency-injection-in-dotnet-core/
so what must i zip and submit?
from these files
@SpReeD ?
Well, that's what you got ¯\_(ツ)_/¯
Don't ask me for approval ^^
i am asking for opinion
do I need to give the bin folder alone?
or everything?
I can't help you with that, dunno what your professor actually wants; like an essay about the topic to sourcecode or some diagrams, etc.
should the exe be working?
It means it compiles, but no, it's not working, again, it's just an example code.
Something else
Do i need the .gitignore file?
what is it
Spreed can i ask you something?