Serilog's AddSerilog is not recognized - c#

I'm trying to call loggerFactory.AddSerilog(); as per this documentation, but the AddSerilog method is not recognized:
"Error CS1061 'ILoggerFactory' does not contain a definition for 'AddSerilog' and no extension method 'AddSerilog' accepting a first...".
I'm using ASP.NET CORE with the full .NET framework.
What am I doing wrong?

You may forget this following line in project.json
"Serilog.Extensions.Logging": "1.0.0",
See also https://carlos.mendible.com/2016/09/19/step-step-serilog-asp-net-core/

Different circumstance, but same problem. In my case, I was using .Net Core 2.1 and had a NuGet reference to Serilog, but was missing a reference to Serilog.AspNetCore. The issue first manifested as .UserSerilog() not being found for the IWebHostBuilder of my CreateWebHostBuilder static method under Program.cs.
Adding the Serilog.AspNetCore NuGet package to my project solved the problem.

The posted answer is correct but I will add that you may want to use the NuGet package manager that way you can get the latest version.
Right click on solution
-> Choose "Manage NuGet packages for solution"
-> type "serilog.extensions.logging" into search box
-> Click on Serilog.Extensions.Logging and press install
You will get a dropdownlist of the different versions you should choose the latest.
Or quicker from Package Manager console verify that Default Project drop-down has your project selected and run
install-package Serilog.Extensions.Logging

On .NET Core 3.1, within a console app, I simply had to install the serilog.extentions.hosting NuGet package.
This will add the below line to the ItemGroup within YourProjectName.csproj
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.7" />

If you have package Serilog.Extensions.Logging added to your project already, it could be just a matter of adding using Serilog; to the top of your code file.

Related

How to configure EF connection string from .NET Standard library? No UseSqlServer in DbContextOptionsBuilder? [duplicate]

I am new to EF core and I'm trying to get it to work with my ASP.NET Core project.
I get the above error in my startup.cs when trying configure the DbContext to use a connection string from config. I am following this tutorial.
The problematic code is in startup.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.SpaServices.Webpack;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
using tracV2.models;
using tracV2.data;
namespace tracV2
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
services.AddSingleton<IConfiguration>(Configuration);
string conn = Configuration.GetConnectionString("optimumDB");
services.AddDbContext<tracContext>(options => options.usesqlserver(conn));
}
The UseSqlServer method is recognized if I put it directly into the context:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
namespace tracV2.data
{
public class tracContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("myrealconnectionstring");
}
All my research online points to missing references, but I can't seem to find out which one I am missing (see image).
First we install the Microsoft.EntityFrameworkCore.SqlServer NuGet Package:
PM > Install-Package Microsoft.EntityFrameworkCore.SqlServer
Then, after importing the namespace with
using Microsoft.EntityFrameworkCore;
we add the database context:
services.AddDbContext<AspDbContext>(options =>
options.UseSqlServer(config.GetConnectionString("optimumDB")));
adding
using Microsoft.EntityFrameworkCore;
manually solved the problem for me
Found that here
Edit...
for dotnet core 3.1 add
Microsoft.EntityFrameworkCore.SqlServer
Follow the steps below.
Install Entity Framework Core Design and SQL Server database provider for Entity Framework Core:
dotnet add package Microsoft.EntityFrameworkCore.Design
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
Import Entity Framework Core:
using Microsoft.EntityFrameworkCore;
And configure your DbContext:
var connectionString = Configuration.GetConnectionString("myDb");
services.AddDbContext<MyDbContext>(options =>
options.UseSqlServer(connectionString)
);
Install below NuGet Package will solve your issue
Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.SqlServer
EntityFramework UseSqlServer Solved
Install-Package Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
Install-Package Microsoft.EntityFrameworkCore.SqlServer
I believe this can be solved by adding a project reference to Microsoft.EntityFrameworkCore.SqlServer.Design
Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design
Microsoft.EntityFrameworkCore.SqlServer wasn't directly installed in my project, but the .Design package will install it anyway as a prerequisite.
The Package is missing. Open Package Manager Console and execute the code below:
Install-Package Microsoft.EntityFrameworkCore.SqlServer
your solution works great.
When I saw this video till 17 Minute: https://www.youtube.com/watch?v=fom80TujpYQ
I was facing a problem here:
services.AddDbContext<PaymentDetailContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DevConnection")));
UseSqlServer not recognizes so I did this
Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 3.1.5
&
using Microsoft.EntityFrameworkCore;
Then my problem is solved. About me: basically I am a purely PHP programmer since beginning and today only I started .net coding, thanks for good community in .net
Install the following packages from Nuget :-
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Sqlite.Core
I was using Visual Studio Code.
1) Try to install the package 'Microsoft.EntityFrameworkCore.SqlServer' by specifying the version number.
VS Code:
'dotnet add package Microsoft.EntityFrameworkCore.SqlServer -v 1.1.1'
Visual Studio:-
'Install-Package Microsoft.EntityFrameworkCore.SqlServer -v 1.1.1'
Refer the link 'Package 'Microsoft.EntityFrameworkCore.SqlServer' is incompatible with 'all' frameworks in the project' for doing it.
2) Then add the namespace 'using Microsoft.EntityFrameworkCore;' manually in the Startup.cs file.
Refer the below link
https://github.com/aspnet/EntityFramework/issues/7891.
3) If you get any dependency issue for 'Microsoft.EntityFrameworkCore.SqlServer.Design', like "Package 'Microsoft.EntityFrameworkCore.Design' is incompatible with 'all' frameworks in project" ,we need to run the below command,
VS Code:-
dotnet add package Microsoft.EntityFrameworkCore.Design -v 1.1
Visual Studio
Install-Package Microsoft.EntityFrameworkCore.Design -v 1.1
Project -> ManageNugetPackages -> Browse -> Search "Microsoft.EntityFrameworkCore.SqlServer" and install or update.
As mentioned by top scoring answer by Win you may need to install Microsoft.EntityFrameworkCore.SqlServer NuGet Package, but please note that this question is using asp.net core mvc. In the latest ASP.NET Core 2.1, MS have included what is called a metapackage called Microsoft.AspNetCore.App
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/metapackage-app?view=aspnetcore-2.2
You can see the reference to it if you right-click the ASP.NET Core MVC project in the solution explorer and select Edit Project File
You should see this metapackage if ASP.NET core webapps the using statement
<PackageReference Include="Microsoft.AspNetCore.App" />
Microsoft.EntityFrameworkCore.SqlServer is included in this metapackage. So in your Startup.cs you may only need to add:
using Microsoft.EntityFrameworkCore;
In Visual Studio, check the NuGet Package Manager => Manage Packages for Solution, check all this packages, whether got installed in your solution or not, as below:
EntityFrameworkCore
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.InMemory
Microsoft.EntityFrameworkCore.Relational
Microsoft.EntityFrameworkCore.Sqlite.Core
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
I solved the same issues after check all the above packages have been installed.
Install package, EntityFrameworkCore.SqlServer:
PM> Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 3.1.3
Nuget:
https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.SqlServer/
I also had the same problem. I added the following. It works for me
Microsoft.EntityFrameworkCore.SqlServer
In my case :-
I have hit the below command and it is resolved.
Command
Install-Package Microsoft.EntityFrameworkCore.SqlServer -v 1.1.1
I add SqlServer and Sqlite to my project, the same problem arises.
For me, I installed Microsoft.EntityFrameworkCore earlier, it's version is 5.0.6. Now Microsoft.EntityFrameworkCore.SqlServer version is 5.0.7. There is no UserSqlServer method after installation.
1. Try to upgrade the tool version to be consistent
Try to modify the version in csproj:
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.7">
Or open NuGet to update the package.
2. Restart your Visual Studio
If it won't help you, the most important thing is to restart VS
And then, everything is OK.
reference
https://github.com/dotnet/efcore/issues/7891
For me this issue happened with Visual Studio Code and I was able to fix with 2 steps:
Manually adding using Microsoft.EntityFrameworkCore;
Running dotnet build in terminal.
first add Install-Package Microsoft.EntityFrameworkCore.SqlServer
next add in your .cs file using Microsoft.EntityFrameworkCore;
finally add this in your core Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddEntityFrameworkSqlServer().AddDbContext<ApplicationContext>(options => options.UseSqlServer(Configuration.GetConnectionString("MovieContext")));
}
For anyone still having this problem:
Use NuGet to install:
Microsoft.EntityFrameworkCore.Proxies
This problem is related to the use of Castle Proxy with EFCore.
Wow so many answers yet none mentioned this Microsoft.EntityFrameworkCore.InMemory package!
Add the reference to this package:
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.2" /> and you should be good to go.
If you are facing this issue in case of Sqlite then
.
I think this is the problem with version of Sqlite,I had the same problem when I was using this versions of SqLite
Version 2.2.4:
After checking version here I changed the version then it worked.
No error after using this
Version 2.1.2:
Easy way to fix this issue
Error message:
Solution:
to install "microsoft.entityframeworkcore.sqlserver" with NuGet
Fixed :
PS: make sure you have using EF on the content "using Microsoft.EntityFrameworkCore;"
I read and did everything instructed in every answer and I just found out my problem was a missing constructor on my DbContext
public Context(DbContextOptions<Context> options) : base(options) { }
I hope this helps anyone facing the same problem I was.
I got around this by simply:
Add SqlServerDbContextOptionsExtensions to the class in question
Resolve SqlServerDbContextOptionsExtensions
This fixes the issue, must be missing some reference by default.
I had this trouble when I moved to Microsoft.EntityFrameworkCore.SqlServer v3.0.0 and Microsoft.EntityFrameworkCore.Tools v3.0.0
When I changed back to v2.2.6 on both libraries, the error went away. This is more of a workaround than a solution but it'll get you up and running till the issue is fixed.
Currently working with Entity Framework Core 3.1.3. None of the above solutions fixed my issue.
However, installing the package Microsoft.EntityFrameworkCore.Proxies on my project fixed the issue. Now I can access the UseLazyLoadingProxies() method call when setting my DBContext options.
Hope this helps someone. See the following article:
Lazy Loading in EF Core
For asp.net core version 2.1 make sure to add the following package to fix the problem. (At least this fix the issue using SQLite)
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
dotnet add package Microsoft.EntityFrameworkCore.Design
Here is the reference of the documentation using SQLite with entity framework core.
https://learn.microsoft.com/en-us/ef/core/get-started/netcore/new-db-sqlite
I had this issue, it seems that I hadn't added the required NuGet packages, although I thought I had done so, make sure to check them, one by one.
Install-Package:
**Microsoft.EntityFrameworkCore.SqlServer**
then add the top of your class:
**Microsoft.EntityFrameworkCore;**
that's worked for me

What is wrong with this code. Why can't I use SqlConnection?

I am 100% newbie to SQl and wanted to make a ConsoleApp with the use of database. I read some about it and tried. When I needed to make SqlConnection, my VS 2019 Preview showed me this
Severity Code Description Project File Line Suppression State
Error
CS1069 The type name 'SqlConnection' could not be found in the namespace 'System.Data.SqlClient'.
This type has been forwarded to assembly 'System.Data.SqlClient, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' Consider adding a reference to that assembly.
ConsoleApp1 C:\Users\User\Desktop\Bald Code\ConsoleApp1\ConsoleApp1\Program.cs 12
Active
i don't get why it doesn't work
Here's my code
using System;
using System.Data;
using System.Data.SqlClient;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string connectionString;
SqlConnection cnn;
}
}
}
If you just updated EntityFrameworkCore from version 2.x to 3.x and you're running into this, change your using statement to Microsoft.Data.SqlClient instead of System.Data.SqlClient.
If you're using EntityFrameworkCore.SqlServer it already has that as a dependency, so you shouldn't need to install it explicitly.
This Microsoft blog explains the change.
Assuming that you're using .NET Core - just add NuGet package: System.Data.SqlClient
Your .csproj might look similar to:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.5.1" />
</ItemGroup>
</Project>
Most likely the System.Data.SqlClient.DLL in not in the Bin folder, and you have not set reference to the DLL in the project. You have missed the database choice when You install visual studio. And now You just manually add references named "System.Data.SqlClient".
1.right click you project name and choose nuget package options.
2.search "System.Data.SqlClient" and install it.
Hope this is fix Your Error
The specific way to fix this from within VS Code is to
Open a terminal by going to Terminal -> New Terminal
Run dotnet add package System.Data.SqlClient
Run dotnet restore
That last command might not be necessary, but doing this made it work for me. It seems that console app templates don't come prepared for a reference to SqlClient.
Update
I think moving forward projects should use Microsoft.Data.SqlClient and not System.Data.SqlClient: https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient/.
As #Mmm mentioned in the comments if you are using .NET Core and have already installed the System.Data.SqlClient package, closing and reopening the project resolved the issue for me too.
I had that error today and what's happening its that VS CODE its no recognizing System.Data.SqlClient;, that's why you can't call the variable...
How did I fix it??
I installed:
SQL server compact toolbox
Nuget Package version updater
Close visual studio/Open it again and your program should be rocking and popping!!
[!["Manage Nuget Package for Solution"]
it fixed my issue.
[1]: https://i.stack.imgur.com/hpk2e.png
I just installed nuget package from the "Manage Nuget Package for Solution". Previously I had used through command but that did not work so I used the UI to install this package.
NuGet Package
Install-Package System.Data.SqlClient
solve my problem.
For me System.Data.SqlClient was already installed. What i had to do was, I went to the Nuget package manager and downgrade the version to 4.8.2 from 4.8.3 and it worked.
It's pretty simple
Go to solution explorer > right click & click manage NuGet packages > and install System.data.SqlClient 4.5.1. or later.
Click here to screenshot

How do I add assembly references in Visual Studio Code?

So I've come across a similar issue twice now while working on my first project in C#. When trying to add either using System.Data; or using System.Timers;, I get the following error:
The type or namespace name 'x' doesn't exist in the namespace 'System' (are you missing an assembly reference?).
I have tried beginning a new project and running restore to see if I had accidentally removed something in the dependencies, but upon generating a new project I still receive the same error. I have tried to research the question and have seen answers referring to the 'solutions explorer', but as far as I can see there doesn't seem to be such a feature by this name in Visual Studio Code 1.8.
Can anyone point me in the right direction for how to get these working, perhaps by manually adding into the dependencies?
.csproj Project file
The following topic applies to .csproj project file and : .NET Core 1.x SDK, .NET Core 2.x SDK
Adds a package reference to a project file.
dotnet add package
Example
Add Newtonsoft.Json NuGet package to a project:
dotnet add package Newtonsoft.Json
.json Project file
The following topic applies to .json project file:
This guide walks you through the process of adding any assembly reference in Visual Studio Code. In this example, we are adding the assembly reference System.Data.SqlClient into .NET Core C# console application.
Note
At step #6, enter the assembly reference that you want.
Some assembly reference is applicable to .NET Framework and it will gives you error(s).
OleDb is not available in .NET Core, probably because it's not cross platform.
Prerequisites
Install Visual Studio Code
Install .NET Core SDK (Preview 2 version)
Install NuGet Package Manager from the Visual Studio Code Extension Marketplace
Install C# extension from Visual Studio Code Extension Marketplace
Steps
Launch Visual Studio Code
Open your project folder
Launch VS Code Command Palette by pressing F1 or Ctrl+Shift+P or Menu Bar > View > Command Palette
In Command Palette box, type nu
Click on NuGet Package Manager: Add Package
Enter package filter e.g. system.data (Enter your assembly reference here)
Press Enter
Click on System.Data.SqlClient
The following prompt pops up
Click on Restore
The following Output panel pops up
In the Explorer panel, click on project.json to open it
In the Editor panel, it shows the assembly reference added into project.json file
Assembly reference, System.Data.SqlClient used in Program.cs
Use the command dotnet add package to add a package reference to your project. For example: dotnet add package Newtonsoft.Json, which adds the package reference to the *.csproj project file:
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
and now you can run the command dotnet restore to restores the dependencies of your project.
Reference: dotnet add package
drag the dll file and drop it into the bin folder
Above answer from ikolim doesnt work as indicated by someone else too, there is no, Nuget: Install/Reference command. There is only Add Package! So the answer in the below link solved my problem. Manually editing the Myproject.csproj file.
Duplicate of this thread
I've stored the files in a project folder named "dlls" and added the reference files in my .csproj file like this:
<ItemGroup>
<Reference Include="Microsoft.Office.Client.Policy.Portable">
<HintPath>dlls\Microsoft.Office.Client.Policy.Portable.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.TranslationServices.Portable">
<HintPath>dlls\Microsoft.Office.Client.TranslationServices.Portable.dll</HintPath>
</Reference>
</ItemGroup>
In case of extisting .dll reference,
Right click project
Add existing item > select path to .dll
After added dll in project,right click .dll
build-action = Content, Copy-to-output-dir = Always/ or if newer

Entity Framework - The migrations configuration type was not be found in the assembly

I have multiple DbContexts in a C# project and I'm trying to enable migrations. When I specify the full command, i.e.:
Enable-Migrations -ContextTypeName Models.Account.AccountDetailDbContext
A migrations folder is created, with the configuration class, but I then get a message:
Checking if the context targets an existing database...
And then
The migrations configuration type 'Portal.WebUI.Migrations.Configuration' was not be found in the assembly 'Portal.WebUI'.
Even though it has just created the file, it can't find it.
I have the correct project selected in the Package Manager Console
I have tried the command using -verbose, but it gives no additional information
If I copy the dbcontexts and classes into a new project then it all works, so it must be something in this existing project that is making the migration fail, but I can't tell what it is.
I solved this by adding EntityFrameworkCore\ before Add-Migration, i.e. the final statement was:
EntityFrameworkCore\Add-Migration
After give a name for your new migration.
I faced this problem. My solution:
Exit visual studio
Open your project again on visual studio
Rebuild solution
Then the error removed. And I can run the command.
After you run Enable-Migrations and the Configuration file is created, rebuild the project and run Enable-Migrations -Force again.
I had this problem and it was solved by changing the dropdown box at the top of the Package Manager Console to choose the correct project. You may need to maximise the width of the package manager console to see this box.
I managed to resolve this by uninstalling the EF nuget package and then reinstalling it.
I have stumbled upon this problem, and after endless hours of googling and trial and error, the solution to my specific problem was much easier.
Just make sure you have all your EF related nuget packages up to date.
I tried every answer I could find here, but what ended up working for me was: Select all EF related nuget packages
(In my case)
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.Design
EntityFramework
And update them all, into their latest version (In my case)
The issue was that one of the defaults I downloaded of one of these NuGet packages, was outdated and invalid.
Another possible issue worth checking: is your project signed? As I just discovered, this problem can also eventuate if the assembly is signed with a strong name key file. Part of the EntityFramework tool kit is migrate.exe which is called during the migration process. It appears if the assembly is signed, this application can't find the configuration type.
Solution seems to be <Project> → Properties → Signing: untick "Sign the assembly", at least while performing migration tasks. Tick it back when you're done.
I also had this issue because of a spelling mistake in a namespace
I was facing the same issue. What I found was that in my project name, "-" was included as "abc-xyz". I deleted my project and recreated it as "abcxyz" and it worked. Don't rename the project—you have to rename it at every reference. In this case, first uninstall EF and rename it, then install EF again.
I have faced this problem due to version update of EF package. I have solved by reinstalling:
1.Microsoft.EntityFrameworkCore.SqlServer
2.Microsoft.EntityFrameworkCore.Tools
3.Microsoft.EntityFrameworkCore.Design
4.Microsoft.EntityFrameworkCore
The solution is to check the project reference. In my case, I have added Entity Framework and Entity Framework Core references to my project.
To Resolve this I have removed Entity Framework Reference from the project and now EF Core migration commands are working.
using Microsoft.EntityFrameworkCore.SqlServer;
using Microsoft.EntityFrameworkCore.Tools;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore;
Then:
Use EntityFramework6\ before Add-Migration for Entity Framework 6.
Like EntityFrameworkCore6\Add-Migration
In this case First, check NuGet packages
Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools Microsoft.EntityFrameworkCore.Design
most probably missing one of the above packages you get an error.
if missing then install and
do migration using
Add-Migration InitialCreate

Ninject.Web.Mvc.FluentValidation and FluentValidation.MVC4

I have tried setting up Ninject.Web.Mvc.FluentValidation in my ASP.NET MVC4 project
as shown below:
var ninjectValidatorFactory = new NinjectValidatorFactory(kernel);
//ModelValidatorProviders.Providers.Add(new FluentValidationModelValidatorProvider(new NinjectValidatorFactory(kernel)));
FluentValidationModelValidatorProvider.Configure(x => x.ValidatorFactory = ninjectValidatorFactory);
DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false;
but I am getting the below errors:
Error 1 The type 'FluentValidation.ValidatorFactoryBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'FluentValidation, Version=2.0.0.0, ...
Error 2 Cannot implicitly convert type 'Ninject.Web.Mvc.FluentValidation.NinjectValidatorFactory' to 'FluentValidation.IValidatorFactory'. An explicit conversion exists (are you missing a cast?)
I can see the NuGet Package for Ninject.Web.Mvc.FluentValidation is version 3.0.0.0
and the error is telling me it is looking for version 2 of FluentValidation for its dependency.
If I install the NuGet package just for Ninject.Web.Mvc.FluentValidation then it installs the FluentValidation v2 dependency rather than version 3.4.6
but I can also see here: https://github.com/ninject/ninject.web.mvc.fluentvalidation/commit/82096d0afd15c41d01c09fd47f4247682261768e
a note about the project being updated for version 3.4.6
I am currently using NuGet to add the FluentValidation.MVC4 package to my project and then adding Ninject.Web.Mvc.FluentValidation after it (which finds it's dependency already exists and doesn't add it).
I can see that the NuGet package was last published on the 1st April 2013 but when I look at the .nuspec file in my project it shows
<dependency id="FluentValidation" version="3.2.0.0" />
Is there anything I have done wrong with this setup? or a way I can get this working through the package manager console to update the dependency version?
UPDATE: The reason for this is because Ninject.Web.Mvc.FluentValidation is using the signed version of FluentValidation which is strongly named.
David Ebbo has a good post about strong names and binding redirects here
http://blog.davidebbo.com/2011/01/nuget-versioning-part-3-unification-via.html
I still did not bother doing this to fix my problem, the NuGet package only has 1 class, the NinjectValidatorFactory, so it's worth just implementing your own.
To fix my problem for now I have put the NinjectValidatorFactoryclass into my own project. This looks to me like the current NuGet package needs to be updated further before it uses FluentValidation 3.4.6.
enter these codes in Package Manager Console :
Install-Package FluentValidation-Signed
Install-Package FluentValidation.MVC3-Signed -IgnoreDependencies
Install-Package Ninject.Web.Mvc.FluentValidation -IgnoreDependencies
-IgnoreDependencies is important .

Categories

Resources