My project is set to .NET Framework 4.5. I get the following error when attemping to use SimpleIOC (from MVVM Light) in my WPF project:
Error 3 Reference required to assembly 'System.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' containing the implemented interface 'System.IServiceProvider'. Add one to your project.
I can't figure out why it's giving me this error. From what I understand, this is a mscorlib class so I'm not sure where it is getting System.ComponentModel from.
I can write Dim test As IServiceProvider without the compiler complainging. Is there some kind of version issue?
It seems like a possible Visual Studio bug. I created a new WPF project and was able to find the System.ComponentModel.dll in the list of .Net Framework assemblies. For my current project, I ended up browsing to it to add a reference to it. All is well now.
Related
First of all some context: my project exists out of a common project that contains all the DAL stuff and a web project. Now the common project is written in .NET framework 4.5 while the web project is written in .NET Core 2.0.
When trying to acces the repositories of the DAL project I get following error:
Could not load type 'System.Data.Common.DbProviderFactories' from assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Now I'm not sure what to do now. I have added the System.Data.Common nuGet package to my web project, but without succes. How can I slove this problem preferably without altering the common DAL project? Thanks in advance.
I am using Visual Studio 2012 Update 3 and whenever I create a new ASP.NET empty website and build it for the first time compilation is successful but I get a server error when accessing the site of "Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The module was expected to contain an assembly manifest."
If I then go back and build the website again I get a single error of "Object reference not set to an instance of an object" but no line number.
This error occurs whichever framework I am targeting and whether I am using C# or VB.
Can anyone point me in the right direction please?
Thanks,
Richard.
Possibly AjaxControl Toolkit is the issue.
Depending on your Framework version( 4.5, 4.0, 3.5 ),, install the correct version of AjaxControl Toolkit from here: http://ajaxcontroltoolkit.codeplex.com/releases/view/94873.
Another solution I found is to place System.Web.Extensions.dll and System.Web.Extensions.Design.dll directly in the Bin folder of your web application.
I have both PC and Mobile application using SQLite. I have installed and used dll version 1.0.66 and when I have update my dlls to 1.0.85 from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki and I can see PC program working with SQLite database very well but compact framework seems didn't like it.
I did add System.Data.SQLite and when I try to compile it I get
Error 1 The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
I did remove and add System.Data reference but it didn't work. I removed System.Data.SQLite (1.0.85) and added reference again but chose 1.0.66 one then it worked.
I am really confused, why I cant use the latest verion of the reference/dll? Do I have to always have to use the old version on compact framework ?
Thanks for any help.
A public key token of b77a5c561934e089 means that you're referencing a desktop assembly. You must reference a Compact Framework assembly in a Compact Framework application. Those downloads are near the bottom of the page you reference.
Setup:
ASP.NET MVC3
Ninject v2.2.1.4
Ninject v3.0.0.15
Ninject.MVC3 v3.0.0.6
Ninject.Web.Common v3.0.0.7
Using NuGet, my UnitTest project references Ninject v2.2.1.4
My Web Project references Ninject v3.0.0.15, Ninject.MVC3 and Ninject.Web.Common
Problem:
With win explorer open at the bin folder of my web project, I build my solution and I can see Ninject v2.2.1.4 copied into the bin directory of my web project. And then being replaced by Ninject v3.0.0.15.
When i hit F5 to debug, Ninject.dll v3.0.0.15 gets replaced with Ninject v2.2.1.4 causing the following error :
Could not load file or assembly 'Ninject, Version=3.0.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
What gives?
Some thoughts:
Only in your debug build did you have an indirect reference to the
v2 Ninject version. Case in point, I'm guessing when you are doing
your debug build you build your Test project while a release build
does not build your Test project.
When you were building, did you happen to notice what project was being built when the v2 DLL was placed in the bin? Then you'll be
able to figure out what project is referencing the v2 build and be
able to narrow down your search (i.e. the answer would become quite a bit more obvious if it wasn't the Test project).
Never a good idea to reference multiple versions in different projects.
Did you check out what your Web.config and App.config references were pointing to?
Warning 1 The referenced assembly "C:\Users\rzv\Desktop\CompanyAnalyse1.0\AnalyserModel\bin\AnalyserModel.dll" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.
Why do I get this? AnalyserModel is a class library that uses Entity framework code first 5 to save data in a database. I tryed to create a new WCF service application that uses the methods in AnalyserModel. What is wrong?
You need to change the target framework from 4.0 client profile to 4.0.
you can do this on the projects properties page.