Code Monkey home page Code Monkey logo

Comments (10)

Boriszn avatar Boriszn commented on September 28, 2024

Hi @anis1011.

Could you please post your Errors, StackTrace. (or even screen shots with error details)

Thanks,
Boris

from devicemanager.api.

anis1011 avatar anis1011 commented on September 28, 2024

multi-tenant
I have clone the project and set the connection string in appsettings.json as "Server=.\sqlexpress;Database=DeviceDb-ten2;Trusted_Connection=True;MultipleActiveResultSets=true"
and run the migration command:- Update-Database
It doesn't show any error list, simply stop the process as shown in the screenshot
Should I have to do extra configuration stuff to run the project?? Database is not simply updated by running migration ?what should I do?

from devicemanager.api.

Boriszn avatar Boriszn commented on September 28, 2024
  1. Please, try to connect to your local database with SqlServer Management Studio. (or any other IDE which able to connect to SQL Server)
  2. If it it works then try to use connection string: Data Source=(localdb)\\MSSQLLocalDB;Database=DeviceDb-ten2;Integrated Security=True;Trusted_Connection=True;MultipleActiveResultSets=True

from devicemanager.api.

anis1011 avatar anis1011 commented on September 28, 2024

Thanks for the quick response,
there is no problem in connecting my local database with ssms, I have tried using default connection string of the project with datasourse=(localdb)\MSSQLLocalDB but still no change,
But for Testing purpose,I deleted migration folder,It shows this
capture

Here "Add-Migration Initial" command is also not working ... Please Help!!!

from devicemanager.api.

Boriszn avatar Boriszn commented on September 28, 2024

Please try following options:

  1. Ensure that all NuGet packages were Restored. Especially Microsoft.EntityFrameworkCore.Tools
  2. Try use version from development branch.

This docu may help: https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell

Could you please send me VS version and NuGet version ?
So tried many times everything and it works fine. The screen shot below.
image

from devicemanager.api.

anis1011 avatar anis1011 commented on September 28, 2024

All the NuGet Packages are fully Restored, other entity framework core commands like ( Get-Help about_EntityFrameworkCore ) are running ,I think that means EntityFrameworkCore Tools is successfully restored, Sorry I don't get about using developement branch .
My Visual Studio version is 15.5.3 and nuget version is 4.5.0
Note: I simply clone the project and run the update-database, I didn't do any other works, Should I do other stuffs also ? Please Help!

from devicemanager.api.

Boriszn avatar Boriszn commented on September 28, 2024

@anis1011 about development, I meant try to switch version from master to develpment branch (So use this one https://github.com/Boriszn/DeviceManager.Api/tree/develop) and Run Update-Database.

Also please check permission on your DbExpress database. Perhaps, it blocks EF db update somehow.

I will try to reproduce this issue on another PC, because I can't reproduce it on my own. (Everything works fine, Update, Add/Remove migration.)

I will get back to you soon...

from devicemanager.api.

Boriszn avatar Boriszn commented on September 28, 2024

@anis1011 I've tried to reproduce this issue on several other PCs. So, everything works fine...
Perhaps, you have wrong VS Environment variables configuration, this threads may help:

  1. dotnet/efcore#7905
  2. dotnet/efcore#7540 (comment)

Please try. (and tell me the results) :)

from devicemanager.api.

anis1011 avatar anis1011 commented on September 28, 2024

Sometimes solutions are simpler than we think, I have tried many options but solution is simple, I change aspnetcore version to 2.0 from 1.1 in .csproj file ,and guess what? migration commands works . thanks @Boriszn for your continuous support ,I might need your further support to understand the project as I am new to .net core world, thank you once again :) :)
with regards
Anis

from devicemanager.api.

Boriszn avatar Boriszn commented on September 28, 2024

Nice. 👍 Your welcome ;) Glad that you manage to run it.
Sure, also you may found this article useful.

from devicemanager.api.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.