When i converted a VS2008 project to 2010 it shows an error message
The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'. This type has been forwarded to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly
and it was build when we add a reference System.Xaml. What would be the reason for need to add additional reference?
In .Net 3.5/3,0, IComponentConnector (namespace System.Windows.Markup) was part of WindowsBase.dll and it was moved in System.Xaml in .net 4.0 onwards.
It seems you are upgrading your project framework 3.5 to 4.0
The type was moved to the new assembly in .net 4?
You are changing you project to use .net 4 and it's telling you that you need this type from that assembly in .net 4.
if you target .net 3.5 you'll find you wont need to do this.
As a thumb rule, always add the namespace that is documented. The document says to use the namespace System.Windows.Markup. It worked in VS2008 probably because System.Xaml was internally using the namespace System.Windows.Markup.
Related
I am getting the following error:
"The type or namespace name 'SolrNet' could not be found (are you missing a using directive or an assembly reference?)"
I have created a new console application in VS2010 and added into program.cs the line
"using SolrNet;"
I've added the project reference to SolrNet.dll version 0.4.0.2002.
Some versions of solr require a reference to system.web but I do not want to do this and I believe this version doesn't have that as a requirement. I've used the object browser and added references to Nhibernate, Castle, Niject and all the other objects.
How can I get my console app to recognise the SolrNet dll?
In the project properties, change the Target Framework from .NET Framework 4 Client Profile to simply .NET Framework 4
Why can't I add a reference to System.Runtime.Serialization when targeting .net 2.0?
Also if I convert a vs2005 project using System.Runtime.Serialization the vs2010 conversion fails with a build error.
I'm using the DataContract class and the compiler says
The type or namespace name 'DataContract' could not be found (are you missing a using directive or an assembly reference?) C:\Users\my\ClassLibrary1\Class1.cs 8 6 ClassLibrary1
The reason for this is that you need to be using .NET 3.5 to use DataContracts, they are items that were introduced with .NET 3.5 therefore you must target that version.
Here is an MSDN article that talks about one aspect of DataContracts and .NET version.
I just upgraded from VS2008 to VS2010. In the process, I allowed it to upgrade my DLL's to 4.0. I've decided that wasn't a good idea and now I've rolled back.
It all works fine in VS2010, but when it hits my CI server (CruiseControl.Net), I get an error of:
The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?
3.5 is on the server, and other projects that use 3.5 build fine, so I don't think it's a framework issue.
Anyone have any hints?
Make sure you have a reference to System.Core.dll.
I do have a reference to System.Core, but it turned out for one of my projects, when I downgraded, it did not add this bit back into my project file:
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
<Private>False</Private>
</Reference>
The key part there being the RequiredTargetFramework. I was clued into this because it wasn't only Linq that wasn't being found, but also Func<> and Extension method attributes.
It was all 3.5 stuff that was missing.
I have VS 2005, 2008 on my dev box.
New project from other developers who only have 2005 installed. When I build it I get error.
Error 1 Indirect reference is being made to assembly
System.Web.Extensions version 3.5.0.0, which contains
'AjaxControlToolkit.CalendarExtender'. This Project references a prior
version of System.Web.Extensions version 1.0.61025.0. To use
'AjaxControlToolkit.CalendarExtender', you must replace the reference
to System.Web.Extensions with version 3.5.0.0 or higher.
When I change the version of Web.Extentions to 3.5 I get another failure
Could not load file or assembly 'AjaxControlToolkit,
Version=1.0.20229.23876, Culture=neutral,
PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
Should I change the Public key for:
add assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
to the newer one, or is this the wrong thing to do. the Server does NOT have 3.5 runtime.
TIA
If your server doesn't have the 3.5 runtime and you aren't able to install it, I suppose you must stick with the 1.0.61025.0 version of System.Web.Extensions.
I would guess that the problem you are encountering is because the AjaxControlToolkit dll that you are using was built with the 3.5 runtime. Thus, your project is referring both to the 1.0.6... version directly and to the 3.5 version through the AjaxControlToolkit reference, and getting confused. You might try downloading the toolkit source and building it from scratch, referencing the 1.0.61025.0 version of System.Web.Extensions. Then make sure to reference this toolkit instead of the default one.
http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=11121
Also, you might try making sure that all the references to the System.Web.Extensions DLL version number are consistent, both in your project's references and in the web.config file. Note that if you have a reference selected, you can toggle the "SpecificVersion" property to True in the Properties panel; presumably this makes .NET more picky as to which DLL version it chooses.
I want to learn to use Fluent NHibernate, and I'm working in VS2010 Beta2, compiling against .NET 4, but I'm experiencing some problems.
Summary
My main problem (at the moment) is that the namespace FluentNHibernate isn't available even though I've imported all the .dll assemblies mentioned in this guide.
This is what I've done:
1. I downloaded the Fluent NHibernate source from here, extracted the .zip and opened the solution in VS. A dialog asked me if I wanted to convert the solution to a VS2010 solution, so I did.
2. I then went into each project's properties and configured all of them to compile for .NET 4, and built the entire solution.
3. I copied all the .dll files from /bin/Debug/ in the FluentNHibernate to a new folder on my local hard drive.
4. In my example project, I referenced FluentNHibernate.dll and NHibernate.dll from the new folder.
This is my problem:
If I right-click on FluentNHibernate in the References list and select "View in Object Browser...", it shows up correctly.
Now, when I try to create a mapping class, I can't import FluentNHibernate. This code:
using FluentNHibernate.Mapping;
namespace FluentNHExample.Mappings
{
}
generates an error on the using statement, saying
The type or namespace 'FluentNHibernate' could not be found (are you missing a using directive or an assembly reference?).
The FluentNHibernate assembly is still in the list of References of my project, but if I try to browse the assembly in Object Browser again, it can't be found.
What is causing this?
I also had similar problem.
"Error List" window displayed:
The type or namespace name 'FluentNHibernate' could not be found (are you missing a using directive or an assembly reference?)
But "Output" window was displaying detailed information:
warning MSB3253: The referenced assembly "FluentNHibernate" could not be resolved because it has a dependency on "System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 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.
In my case; I had created a console application project which was targeting ".Net Framework 4 Client Profile" by default, so changing to ".Net Framework 4" fixed issue for me.
I'm unable to observe this behavior in my build, could it be related to this problem: Weird override problem with Fluent NHibernate and .NET 4
If so you could try http://groups.google.com/group/fluent-nhibernate/browse_thread/thread/ae4013d711d2e4ad as a potential fix.
Isn't there a better way to fix this problem?
I don't want to reference System.Data.OracleClient. So I shouldn't have to target the full .Net framework if I don't even want that reference.
Can't I target the Client Profile of the .Net framework, but add a compiler warning exception somewhere so that it just skips that warning? I know it won't cause a runtime problem because I don't use Oracle.
I get identical problem which says there's also a dependency on System.Web. Same story, this is for a Windows WPF app, so I don't need System.Web. Can't I just target the Client Profile and somehow convince the compiler to keep going?
Thanks,
Hugh
EDIT: I figured this out! I had to compile NHibernate myself though. Opened the 2.1.2 code in Visual Studio and deleted everything that says "Oracle" or "System.Web" and I ended up getting it to build. I do not have to target the full .Net Framework now.
We had this issue and the issue went away if we removed the obj and bin folder from the project which was referencing the NHibernate using project.
So we have 'project1' which uses NHibernate to produce project1.dll.
'project2' references project1.dll.
Problem resolved if we removed the obj/bin folder from project2.
Can't say why, but our solution now compiles fine.
Mike.