ASP.NET Mvc Project EF Code First Enable Migrations Error - asp.net-mvc-4

I am working PluralSight Video Tutorials on ASP.NET MVC. And i couldn't enable migrations on package console..
when i wrote enable-migrations, i am receiving this error;
More than one context type was found in the assembly 'eManager.Web'.
To enable migrations for eManager.Web.Infrastructure.DepartmentDb, use Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb.
To enable migrations for eManager.Web.Models.UsersContext, use Enable-Migrations -ContextTypeName eManager.Web.Models.UsersContext.
when i wrote Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb., i am receiving this error;
The context type 'eManager.Web.Infrastructure.DepartmentDb.' was not found in the assembly 'eManager.Web'.
Thanks for your help.

I strongly suspect that your issue is similar to the one in this question:
How to Enable Migration to update my database in MVC4?
Check the selected answer and see if that helps with your issue.

The solution for the mentioned error "The context type .... was not found" is to select the correct project that holds the context type before running the enable-migration command. You can choose the correct project from the "default project" drop down at the top of Nuget manager tool window.

The solution to this problem is simple, just remove the dot (.) at the end of this statement "Enable-Migrations -ContextTypeName eManager.Web.Infrastructure.DepartmentDb." and run the package manager console again, the migration should be enabled.

Related

ASP.NET Core error on building with NSwag Error MSB3073

When I build the application, I get the following error message
The command "dotnet "C:\Users\Adminuser\.nuget\packages\nswag.msbuild\13.0.6\build\../tools/NetCore22/dotnet-nswag.dll" run /variables:Configuration=Debug" exited with code
-2147450730. Northwind.WebUI C:\Users\Adminuser\Documents\Visual Studio 2017\Projects\NorthwindTraders-master\Northwind.WebUI\Northwind.WebUI.csproj 60
Any Idea how to fix this issue?
Swagger doesn't like it when two or more endpoints in the same Controller share the same name. make use of routing attributes and make sure they are unique.
Try to install NSwagStudio then re open your visual studio.
That's should solve your problem.
If it's still not working
give a look about your output console when you try to compile your project, you should see something like this
1>Executing file 'nswag.json' with variables 'Configuration=Debug'...
1>Launcher directory:
C:\Users\Shadow.nuget\packages\nswag.msbuild\13.1.6\tools\NetCore30
You should have a file called dotnet-nswag.exe in your c:\user...\tools\netcore30 directory.
Put this exe in your environnement path.
Re open visual studio and your error should be gone.

yii creating webapp error

Hi i am trying to create a yii application and i am got this issue tried google but not able to find the solution how can i resolve this,..?
This is my error:
Error: Unsupported VCS specified. Currently only git and hg supported.
And what actually this error is..?
yiic webapp d:\xampp\htdocs should work.
Notice the backslashes.
Or, perhaps better, since the app generator supports relative paths, navigate to d:\xampp and simply run yiic webapp htdocs.
That said: why are you using Yii 1 ?
It is really old, and does not receive any updates.
Yii 2 is so much better :)

BB Web Works giving error as "error feature cannot be found in any extension(blackberry. pin .memo)" while packaging the app

I am new to BlackBerry Web Works.I am following the instruction for development given on development site.While packaging the Application I am getting this error in command prompt : "[ERROR] feature cannot be found in any extension(blackberry. pin .memo)".
Before going to this step I have already created project folder with config.xml and index.html and also zip file of application components properly.And now trying to package the application.But I am getting error like:
Please help me to figure out this error.
Thanks
Finally I got the solution after a lot of searching and analogy.
This error occurs when either we have added some feature in config.xml which we are not using in our application or when we are using same feature but not defined in "feature" tag in config.xml. It is the same case with "spinner" ,"sms" etc.
In my case it was because of "memo" ,which I was defining in config.xml but didn't use any Contact feature in my Application.So it producing error like "feature cannot be found in any extension(blackberry. pin .memo)".

how to use glimpse with petapoco?

I installed this plugin from nuget.
I enabled glimpse through the glimpse.axd file but when I go to the petapoco tab I see this message
"No database requests or database logging not switched on (Compilation debug='true' or ForceLogging='true' on PetaPoco.DatabaseWithLogging)"
where do I set this logging?
You need to create a new DatabaseWithProfiling() not Database() as you normally would. Checkout out the code in the Model folder after you have pulled it down from NuGet.

Team Build sends error when trying to compile a Structuremap method

I'm getting a strange error when trying to compile a solution that is using StructureMap on Team Build.
When I try to compile the solution locally on Visual Studio it works fine, but when trying to queue a new build in Team Build I get the following error:
Overload resolution failed because no accessible 'Use' can be called with these arguments:
The line of code that gets this error is the second one:
ForSingletonOf(Of ISessionFactory)().Use(NHibernateSessionFactory.SessionFactory)
Me.For(Of ISession)().lifecycleIs(New HybridLifecycle()).Use(Function(x) x.GetInstance(Of ISessionFactory)().OpenSession())
It's a standard registration for the NHibernate session, so I don't really get why this error pops up.
Thanks in advance for the clues.
Make sure you have the correct version of NHibernate on the build server, and that your hint paths are all appropriately set in your project file. We haven't had this specific issue (as we're not using NHibernate), but we've had weird issues like that being related to version mismatches of "infrastructure" DLLs between local and build.