I have add new infragistics references version 14.1 to my references(v12.1) by using utility and so when i add references with new version than i got some errors...
"Error 6404 The type or namespace name 'Infragistics' could not be found (are you missing a using directive or an assembly reference? ...etc"
it is still finding references of the old version
After installing Infragistics 2014, you should see a menu item in Visual Studio called INFRAGISTICS. Click on that and click on Check for Updates. It will scan your projects for old references, and upgrade all the namespaces and controls to the latest versions. Click on the Upgrade button next to each project that comes up in the list. This will remove all the errors.
Check references to Infragistics dll(s) in your application's config file.
Related
I first time using Excel to reading data in c# with Selenium WebDriver, but when I build this code, it pops up an error:
"Missing compiler required member 'microsoft.csharp.runtimebinder.binder.convert'"
and the code for using excel is marked in red bellow:
excel.Application x1Appl = new excel.Application();
excel.Workbook x1WorkBook = x1Appl.Workbooks.Open(#"C:\app\o\SearchBy.xlsx");
excel._Worksheet x1WorkSheet = x1WorkBook.Sheets[1];
Please let me know what is missing? Thank you!
The reference assemblies for Office are exposed via the dynamic return type. To be able to compile you need to add a reference to Microsoft.CSharp.dll.
In addition to what #Alex Ghiondea says, go to the references section of your project:
Right click on references and check the prompted options.
Click on add reference and a modal with the left menu (assemblies, projects, COM and browse) will appear.
Click Assemblies
Check Microsoft.CSharp and click Ok.
Clean and build your project and the error should disappear.
If your project is targeting .Net Core or .Net Standard, then installing the Microsoft.CSharp NuGet package will solve this error.
Add a reference of Microsoft.CSharp
to your project by using NuGet.
or
Install-Package Microsoft.CSharp -Version 4.7.0 for the project
right click on project name (in solution explorer),
Add refrence : Microsoft.CSharp in the assemblies , then right click again and Clean.
that's all.
I'm using Visual Studio 2017 Version 15.7.1 (not sure if this matters or not, but this error seems to have cropped up after I updated). I had a project that was targeting .NET Framework 3.5. So, in addition to the other answers provided for adding Microsoft.CSharp, I needed to update this project to .NET Framework 4.5, and then Microsoft.CSharp showed up under Assemblies when I went to add the reference. Before then, I had to find the absolute path to the DLL, which didn't seem to work.
For those who can't upgrade to 4.5, you can try setting EmbedInteropTypes to False for all interop references in your csproj file, as shown here: http://answers.flyppdevportal.com/MVC/Post/Thread/b1554cdd-ad9e-4453-b4d6-8eb03da175ea?category=visualstudiogeneral
I had this problem as well. If you right click and select Properties (While project is highlighted), there is a checkbox that says: Auto-generate binding redirects. This fixed it for me.
I am using Visual Studio 2017 and it is a C# class library.
I started using Xamarin Studio, and the version is 6.0.1 build 9.
I downloaded sample projects to check its behavior.
I downloaded the projects from the official website.
https://github.com/xamarin/urho-samples
When I start building the project, the error happens as follows.
Error CS0234: The type or namespace name iOS' does not exist in the
namespaceUrho'. Are you missing an assembly reference? (CS0234)
(Urho.Samples.iOS)
error image
I guess I need to fix the building setting, but I don't know how to deal with it.
I'd appreciate your advice.
You are probably missing one or more NuGet packages as indicated by the message.
You can restore the package automatically by going to you solution view, find the project that is missing references, right-click the packages node and click the Restore option.
Here you can also Update all packages or add them.
This is one of the first things you want to do when getting a external project of at first checkout. There is also the option of doing this automatically when building.
For this go the the Xamarin Studio menu option, the Preferences and find the NuGet section. Under General you can check an option to do this automatically when building a solution.
Also, you can let it check for updated packages. Then you will see the '(x.x.x available)' suffix like in the first screenshot.
Everything worked fine until I installed (Package Manager Console) the postal package, then uninstalled and installed an older version.
Now I get an error where it previously was not.
Error:
The type or namespace name 'AllowAnonymous' could not be found (are you missing a using directive or an assembly reference?)
Who knows how to fix this?
Probably you are missing the reference to System.Web.Http assembly in your project?
So you need to:
Add the reference to System.Web.Http;
Add using System.Web.Http; to your controller;
To add Reference you need to do next steps:
In Solution Explorer, right-click the project node and click Add
Reference.
In the Add Reference dialog box, select the tab Assemblies, and enter System.Web.Http into search on the right side.
Select the component System.Web.Http, and then click OK.
Link:
How to: Add or Remove References By Using the Add Reference Dialog Box
Updated answer for 2021 on .Net 5.0, turns out I was missing this line:
using Microsoft.AspNetCore.Authorization;
I had the same problem. After reinstalling a package, MVC 5 was removed and then MVC 3 was added! The following command fixed the problem:
PM> update-package
I'm trying to use DataAnnotations in my WPF project to specify a maximum length of strings, with the following:
using System.ComponentModel.DataAnnotations;
However, I get the error
The type or namespace name 'DataAnnotations' does not exist in the
namespace 'System.ComponentModel' (are you missing an assembly
reference?)
I've seen other examples where DataAnnotations does exist in this namespace. I'm using C#4. Is there any reason why I can't use this? What can I do to fix it?
You have to reference the assembly in which this namespace is defined (it is not referenced by default in the visual studio templates). Open your reference manager and add a reference to the System.ComponentModel.DataAnnotations assembly (Solution explorer -> Add reference -> Select .Net tab -> select System.ComponentModel.DataAnnotations from the list)
If using .NET Core or .NET Standard
use:
Manage NuGet Packages..
instead of:
Add Reference...
To Reference System.ComponentModel.DataAnnotations
In a code file to have Using System.ComponentModel.DataAnnotations; at the top of the file such as:
using System.ComponentModel.DataAnnotations;
Add a .NET reference to your project by right clicking the project in solution explorer:
Hope this helps! This question helped me.
If you don't have it in references (like I did not) you can also add the NuGet System.ComponentModel.Annotations to get the assemblies and resolve the errors. (Adding it here as this answer still top of Google for the error)
I also had the same problem and I resolved by adding the reference in one of my projects which didn't had the mentioned reference. If you have 2-3 projects in your solution, then check by adding this reference to the other projects.
I found that I cannot reference System.ComponentModel.DataAnnotations from Silverlight 5 with the below version at (1). I found that Silverlight 5 assemblies cannot use .NET assemblies, it gives the error "You can't add a reference to System.ComponentModel.DataAnnotations as it was not built against the Silverlight runtime. ..." I plan to workaround this by hopefully installing the Silverlight 5 package found at (2) below. If this fails I will update this post.
[UPDATE: it failed. I installed everything relating to Silverlight 5 and I don't have the Silverlight version of the .dll assembly System.ComponentModel.DataAnnotations . Too bad. UPDATE II: I found an old .dll having this name from a previous installation of Silverlight developer's kit for Visual Studio 2008 or 2010. I added this file and it seems to 'work', in that IntelliSense is now recognizing attributes on class members, such as [Display(Name = "My Property Name")]. Whether or not this works for everything else in this .dll I don't know.]
(1)
Microsoft Visual Studio Professional 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.51641
Installed Version: Professional
(2)
http://go.microsoft.com/fwlink/?LinkId=229318
I searched for help on this topic as I came across the same issue.
Although the following may not be the Answer to the question asked originally in 2012 it may be a solution for those who come across this thread.
A way to solve this is to check where your project is within the solution. It turns out for my instance (I was trying to install a NuGet package but it wouldn't and the listed error came up) that my project file was not included within the solution directory although showing in the solution explorer. I deleted the project from the directory out of scope and re-added the project but this time within the correct location.
Use the FrameWork version 4.5 and above for your project then problem solved.Because this namespace is under 4.5 and above.
System.ComponentModel.DataAnnotations is contained in its own assembly so you need to make sure you have it refernced. Just simply:
1). Right click on Soloution and choose add.
2). Choose reference from the list.
3). Search " System.ComponentModel.DataAnnotation " and tick the check box on its left hand side and press ok.
Job done, shouldnt have any refernce errors.
If you tried to update visual studio from vs2008 to vs2010. And your app uses framework 3.5 (and you don't want to upgrade it), and also used WCF RIA Services BETA... I have bad news... you MUST upgrade to WCF RIA Services v1 (BETA does not work on vs2010)... and due to this... you also have to install Silverlight 4 + upgrade to framework 4.0
See this:
http://blog.nappisite.com/2010/05/updating-visual-studio-2008net-35-ria.html
I upgraded from Silverlight 4 to Silverlight 5 and then I was having this issue. Although I had a reference to "System.ComponentModel.DataAnnotations" under "References" in my project, it had a yellow yield sign by it that indicated the previously referenced assembly could not be found. It turned out that the properties of the "System.ComponentModel.DataAnnotations" reference indicated "Specific Version = True", when I changed this to "Specific Version = False" it fixed the issue. Right click on the "System.ComponentModel.DataAnnotations" assembly under "References" and select "Properties" from the context menu. Check that the property value for "Specific Version = False".
It must have been referencing the old Silverlight 4 assembly which was no longer available after the upgrade to Silverlight 5.
I also have this problem.
That is very stupid when i add a namespace the same with System. I try to remove all references, but it is not resolved. I use "global::System.ComponentModel", it is working as well.
When i remove my namespace, this problem has been resolved.
For .Net Core in Visual Studio 2019 try this.
see VS suggestion
It worked for me, hope it'll work for you as well.
I was moving from .Net Framework 4.7.2 to .Net Standard 2.0.
In my case, I had to change DataAnnotations's reference from an Assembly reference to a Nuget package.
This error occurs when the reference to the "System.dll" got removed.Solution to the problem is very simple add the reference to "System.dll".The dll is normally available in the following location
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727" .Add the reference your problem will get solved .
There was a problem using System.ComponentModel.DataAnnotation in net40 so I just did:
#if !NET40
using System.ComponentModel.DataAnnotations;
#endif
#if !NET40
[StringLength(256)]
#endif
The NET40 must be a predefined macro definition for .Net Framework 4.0
I had same problem, I solved this problem by following way.
Right click on page, select Property. in build action select Content.
Hope that this solution may help you.
I'm using C#, EF 4 in asp.net 4 and VS 2010.
I'm trying to load namespace System.Data.Linq with this code using System.Data.Linq
and I receive this error:
Error 2 The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
Any idea what I'm doing wrong.
Right click your solution/project. Click Add Reference and search for System.Data.Linq and add the reference there and it should compile.
Just to confirm that Adding the reference to the project didn't work for me because it was already selected.
However, selecting "Copy Local, True" in the Properties pane for the reference made it start working.
That namespace is LINQ-to-SQL, so you'll also need to add a reference to System.Data.Linq.dll; it won't be added by default just by adding Entity Framework.
Try re-change target framework for your project.
Go to Proporties > Application > Target Framework change to another than used now, and next change it back.
VS Installer
The above answers didn't work for me, my problem was that I needed to add LINQ to SQL tools in Visual Studio.
For VS 2022 and project on .NET 6.0 --- Project \ Referencies \ search \ MindBox.Data.Linq, everywhere "OK", install (based on personnel expirience)
Also, may be, need install -- Referencies \MS.System.Linq.Queryable (or MS.Queryable, not remember)
After all action LinqToSQL will be work in project.