how can i fix this error?
hey so I have a asp.net core mvc app and for some reason suddenly it doesnt want to run anymore. it builds just fine but when i try to run it i get:
MissingMethodException: Method not found: 'Microsoft.EntityFrameworkCore.Storage.CoreTypeMapping Microsoft.EntityFrameworkCore.Storage.TypeMappingSourceBase.FindMapping(System.Type, Microsoft.EntityFrameworkCore.Metadata.IModel)'.
It says that it happens in my DbContext:
I dont get why its not working, ive tried:
Completely changing my project structure
Deleting solution file and making a new one
Cleaning solution
Rebuilding
Reinstalling all packages
nothing seems to fix it. any advice? here is my repo: https://github.com/ForkEyeee/realtime-poll36 Replies
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
thanks
i didnt know about mysql being bad
i used postgres when i was using js stack but i only switched to mysql cause my place of work uses it i think
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
hm didnt know that i was actually gonna use postgres when i first started, but i switched to mysql last min. maybe when i finish i will change it to postgres
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
yeah this is the main csproj, i updated everything to 8. and then moved out all of the test dependencies to the test project. so i have the main projectr and the test project under the smae solution.
adn then this is the test csproj
im able to run it now but there is one thing that i am having trouble with now which is detailed under this thread
https://discord.com/channels/143867839282020352/1203036321757528147
i did my best to try to fix it for hours but i have had no luck
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
GitHub
GitHub - romantitov/MockQueryable: Mocking Entity Framework Core op...
Mocking Entity Framework Core operations such ToListAsync, FirstOrDefaultAsync etc - GitHub - romantitov/MockQueryable: Mocking Entity Framework Core operations such ToListAsync, FirstOrDefaultAsyn...
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
my bad i made another thread because it seemed like a different issue. but some things: what do you mean by split test and their dependencies?, as far as i know, i should have the testing dependencies in in the test project, and then everything else in the main project right? am i misunderstanding something here? also the thing is, ive had the tests run before and they pass with all green. i can also run it in the cli and they pass. but as far as testing, creating an in memory database is not a good practice? i should use the actual database instead? I think i shuold switch to postgres now but im not sure about the above.
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
yes i did, i moved them so they are not all in the same csproj. i dont know why i testing stuff in the main csproj but its not like that anymore
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
do you mean
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.10">
? yes i dont think this should be in the testing csprojUnknown User•10mo ago
Message Not Public
Sign In & Join Server To View
oh
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
to be honest ive never used docker before i know its so that it can containorize yoru app so it can run anywhere but no mor ethan that. its on my to learn though
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
ok, so i should be testing like this then, i didnt know. cause i watched a video on unit testing and it didnt mention any of the above
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
oh man thisis alot of information lol. i only started learning .net a week ago, i come from a js background. but i think the firs tthing i should do is switch to postgres right? then i can look into fixing my testing process?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
i still dont undertand where docket comes into play here but i can look at that while im doing this right?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
okay i always thought of e2e like testing in a browser like th euser can clicka buutton adn then something happens
didnt know it can be with just code too
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
ok ill have to check it out then. i dont know why i was using just xunit, i didnt want to run just unit tests, i just wanted to run any sort of tests to be honest. with some googling i was led to xunit and just started using that exclusively.
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
oh
yeah okay, this is alot of new info lol so i think i will start by switchinig to postgres, and then i will follow the integration test tutorial
and try to make sure my dpeendndcies are in order while doing all of that
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
really?
i thought that was the way to do it, atleast according to the msdocs i think
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
so something like this is not recommended? how woudld you do it instead?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
thank you