I have a server that Shrepoint installed on it.
I want to test this code:
SPUtility.GetLocalizedString Method
When I add reference to Microsoft.SharePoint.dll I can resolve SPSite and ... .The problem is When I want to build the project it does not recognize using Microsoft.SharePoint any more:
and I get this error:
Error 13 The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
where is the problem? I add reference to Microsoft.SharePoint.dll but in build time it does not works
Microsoft.SharePoint.dll from SharePoint 2010 use Framework 3.5
but
Microsoft.SharePoint.dll from SharePoint 2013 use Framework 4.0
try it.
Change Visual Studio project solution properties platform target to x64 and the target framework to .NET Framework 3.5.
Try to use this namespace:
using Microsoft.SharePoint.Utilities
In the link you gave, it says that the method resides in Namespace Microsoft.SharePoint.Utilities instead of Microsoft.SharePoint. This is just a guess maybe work, haven't tested it,
Related
I encounter this kind of error when I debug a project
I already have EntityFramework.dll, System.Core.dll, System.Data.Entity but still Core is not referenced.
Can someone help me?
I'm having error in this Line
using System.Data.Entity.Core.Objects;
This is the error:
The type or namespace name 'Core' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?)
Enrique, I had this problem crop up when I started opening a project on my desktop that I had normally been opening on my VM. Masoud's answer is not helpful... I don't think he read your original post.
What I did to clear this compile error up was to open NuGet package manager and install the update that was available for EntityFramework. I had version 6.1.1 installed in the project and I upgraded to 6.1.3. I should not have had the error to start with, but upgrading the version appeared to jiggle whatever it was loose because I started compiling fine after that.
Sometimes, when you add references from other sources than nuget manager (example: Local source) you need to verify the HintPath of that reference before moving your application in another environment
In project i have reference to Microsoft.Office.Word.Server
and in code i have method that takes argument of type ConversionJob, but when i try to compile it i have an errors
The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
The type or namespace name 'ConversionJob' could not be found (are you missing a using directive or an assembly reference?)
but when a press f12 on ConversionJob it tooks me to the class defenition
using Microsoft.Office.Word.Server.Service;
using Microsoft.SharePoint;
using System;
namespace Microsoft.Office.Word.Server.Conversions
{
public class ConversionJob
{
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy, ConversionJobSettings settings);
public ConversionJob(WordServiceApplicationProxy serviceApplicationProxy);
...
what is wrong?
target framework is .Net framework 3.5
Solution
Ive solve the problem. I look to the output and there was message:
Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "<assembly reference>" could not be resolved because it has an indirect dependency on the framework assembly "<assembly" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "<assembly>" or retarget your application to a framework version which contains "<assembly>"
i try to find solution in google and - > http://www.sanderstechnology.com/2011/warning-msb3268-you-are-about-to-experience-pain/10646/#.TtYrXGP20Z8
Check the target framework of your application, might be you´re building for the client profile but the referenced assembly requires the full framework.
Try changing the "Target Framework" to be ".NET Framework 4" instead of ".NET Framework 4 Client Profile".
Project Properties -> Application Tab -> Target Framework
You likely need to delete (MAKE SURE TO BACK IT UP) the 12.x.x.x .dll in your GAC folder, and make sure you are referencing the 14.x.x.x in your solution.
If you look at the project references, is it finding the assembly? The icon will look different if it can't resolve it.
1.Try to delete and then manualy add the reference (sometimes it helps - VS losting needed dll but not show it with another sign if not clean)
if 1. ok then backup and try to remove from GAC folder (to understatnd from where it calls assembly)
Probably you have a namespace or class with the name Office somewhere in your code. The compiler uses your namespace instead Office.
In other words I think you have a name collision with your project or any of the references you have in it.
Please investigate for overlapping namespaces / classes.
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.
Why might "using System.Linq" cause the following error?
The type or namespace name 'Linq' does
not exist in the namespace 'System'
Reference System.Core
And then there are others that merge this namespace too - but that's the primary one on .Net 3.5 and above.
If you're project is currently .Net 2.0, say, and you're using the right version of VS (2005 and above) - you can simply right-click on the proejct properties; and change the 'Target Framework Version' to 3.5. System.Core will then become available.
If you don't see that in the options - then I guess you're using an older VS
The most probable reason is that you are using wrong version of .NET Framework.
Try to add System.Core assembly to your project
You'll get this error if you don't have "System.Core.dll" referenced (the assembly which contains the core LINQ APIs).
System.Linq is available in .Net 3.5 and above version.
Maybe you're targeting an older framework, Linq came in with 3.5 IIRC.
You are using lower version of .NET Framework than 3.5 to compile the source code or you don't have added the System.Core assembly to your project.
Manually type using System.Linq in the starting of the project, you will not be able to find this namespace in add reference dialogue box.
If you are still getting error then try to Add Reference System.Core.
If you are getting an error that it has been already referred then you can unload your project and then edit your csproject file, manually copy reference to System tag and paste and change the name to System.Core and reload the project.
In my case the only thing that worked was:
Adding a new Razor item (e.g. MVC 5 View Page)
That automatically pulls in some NuGet packages
The package that makes System.Linq available to Razor Views IntelliSense seems to be Microsoft.AspNet.WebPages.
I have added Microsoft.SqlServer.Management.Smo.dll reference to my project, but it still gives me the error below. The referenced dll is in C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies path.
Error 25 The type or namespace name 'Smo' does not exist in the namespace 'Microsoft.SqlServer.Management' (are you missing an assembly reference?)
All the classes that I use such as Restore, Serer class under the Smo namesapce also throws the error.
Please advise.
Where are you consuming this from? Any chance you're using the client profile (under project properties -> Application -> Target Framework)? I've been caught out a number of times by that. If that's the case, it's usually as simple as selecting a non-client profile framework version.
Anyway, can we get some more detail about what kind of solution this is?
I have had the same problem, I noticed my project was targeting framework 3.
Changing to 3.5 or 4 helped solve the problem.
My reference are to
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
Microsoft.SqlServer.Management.Sdk.Sfc
I think you have to add all 4 dlls (link):
Most of the classes
Microsoft.SqlServer.Management.Smo
namespace resides in the
Microsoft.SqlServer.Smo.dll and
Microsoft.SqlServer.SmoExtended.dll
files. Additionally, some of the
enumeration classes are in the
Microsoft.SqlServer.SqlEnum.dll and
Microsoft.SqlServer.SmoEnum.dll
assembly files. You will have to
import all four files to access all of
the classes in the
Microsoft.SqlServer.Management.Smo
namespace
If you are using Visual Studio 2008 then
Add References
Microsoft.SqlServer.ConnectionInfo
Microsoft.SqlServer.Smo
Microsoft.SqlServer.SmoEnum
Microsoft.SqlServer.SqlEnum
if still u got error
then add two more dll
microsoft.sqlserver.SmoEx...
Microsoft.SqlServer.ConnectionInfoEx...
Hope it will work
Thank you.
add reference to "Microsoft.SqlServer.Management.Sdk.Sfc.dll" from "C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies" will eliminate this error.