I'm having the following problem using the Visual Studio 2010 Team System Beta 1:
While working on some printing code, I tried to declare a variable of type System.Printing.PrintTicket, but Visual Studio doesn't seem to recognize that the class exists. It appears in the MSDN documentation, and other classes like System.Printing.PrintQueue have variables of type PrintTicket, but even in those cases VS doesn't recognize it as a valid type.
Does anyone knows if that is a bug, or am I missing something??
Thanks...
PD: I have the required reference to the System.Printing.dll file in my project and the required 'using' directive in the class file. As a matter of fact, every class of the System.Printing namespace that I've used works, except for that one.
Ok, I'm definitely an idiot. The problem was that the PrintTicket object is defined in a different assembly than the rest of the System.Printing namespace. I believe that MS should change that but...
Thats it...
Edit: In response to Ivix question, the Assembly where the PrintTicket is defined is ReachFramework (the filename is ReachFramework.dll)
PrintTicket is a .NET 4.5 function, but the Visual Studio 2010 just support up to .NET 4.0.
If you are using Windows XP, .NET version can only up to be 4.0
Related
I don't understand why it appears given error : The type or namespace name "Storage" does not exist in the namespace "Microsoft.Xna.Framework" (assembly reference may be missing).
I try to download Microsoft XNA Framework Redistributable 4.0.
How to fix it?
You haven't given any information to your problem such as code you have written or references added so I'm sorry if this doesn't help. But, if you're using Visual Studio 2019 here is a video to help you add the entire framework to your program.
EDIT: If you already have the framework downloaded. What you need to do is right click your project on the right. then Add>Reference.. then search for Microsoft.Xna.Framework.Storage.
In PresentationFramework from .NET 4.5 there is a namespace called Standard. Look here for more info: What is the namespace 'Standard'?
The problem is that in my C++/CLI project I am using an unmanaged library, which also defines a class called Standard. So I get the following compiler error:
error C2869: 'Standard' : has already been defined to be a namespace
I cannot remove the reference to PresentationFramework, and I cannot stop using the said library. Is there anything I can do? Like un-importing the namespace?
P.S. I am using VisualStudio 2012. I think that an upgrade to 2013 might help, but that will require the whole team to move to it.
That namespace was added to PresentationFramework by .NET 4.5, I believe, and I don't think changing to Visual Studio 2013 will help you. Everything in that namespace is defined as internal, and it mostly consists of Enums and Structs used with Windows SDK functions called by PresentationFramework.
Unfortunately, I have no idea what to do about your problem. Perhaps you can convince whoever supplies the third-party library to change their namespace. The fact that Microsoft is now using it would be a good reason for them to do so. Whoever these people are that are creating namespaces with a simple, generic name such as "Standard" need to have their heads examined.
I recently migrated a solution from VS2005 to VS2010.
The solution is composed by about 20 project. One of them is in VB.net, the others are C#.
In VS2005 everything was fine, that is I was able to reference the VB.net project into the C Sharp projects. Now I cannot anymore.
The strange thing is that when I open in the editor a C# class referencing the VB.net dll, I get a compile error that sounds more or less like this:
"he type or namespace name 'VB.netProject' does not exist in the namespace 'Solution Namespace' (are you missing an assembly reference?)"
... and no, the assembly reference is there indeed!
However, when I close the files in the editor and try to compile again, the operation succeeds and the executable that I get works perfectly like it did in VS2005.
Is there a way I can manage to see the VB.net component in the editor? I am sure I am missing something, but I don't know what! :-)
Many thanks in advance for your help,
John
Unfortunately the visual studio sets (after the migration) the target framework to .NET Framework 4 Client Profile. If this target framework is set, some namespace could not be found (=> because the client profile doesn't contain this classes). Please verify, if your project has set this target framework. You will find this setting under the project properties.
Kind regards, patrick
Trying to upgrade a solution from 2008 to 2010. And I suddenly get a lot of ambiguous reference errors compiling in VS 2010.
It works fine in 2008. Is VS 2010 more strict regarding the using directives?
I had a similar issue.
I dont think it is stricter, but more a coincidences of the newer framework now having the same class name I was using in the dlls referenced, either things were moved or there was some new development to existing dlls.
It took some time to fix the entire project, but the ways around it I found were:
To use either define the full location of the classes
or
define an alias:
using CompanyMagic = Core.Company.Magic;
have you references to two different dll-versions of the same assembly in your solution?
For example are you referencing "System.dll from dotnet 2" plus "System.dll from dotnet 4"?
There is a quite similar post on StackOverFlow : Ambiguous reference error in VS2010
From this article, from Richard :
There may be slight changes in lookup rules about how different cases (e.g. identifier in current namespace takes precedence (as in class Program above).
There are two options to disambiguate:
Use fully qualified identifiers, in the above, either System.Action or ConsoleApplication1.Action.
Use a namespace alias to fully qualify the identifier without so much typing:
using MyAction = MyNamespace.Action;
All, Cannot
I have created a Word2007 Document Project and I'm trying to retrieve the content controls on the page via the GetVSTOObject method but it can not find the Microsoft.Office.Tools.Word.Extensions library after I have referenced the Microsoft.Office.Tools.Word.v9.dll as suggested on the MSDN site.
I would greatly appreciate any help.
Below is the error message:
'Microsoft.Office.Interop.Word.Document' does not contain a definition for 'GetVstoObject' and no extension method 'GetVstoObject' accepting a first argument of type 'Microsoft.Office.Interop.Word.Document' could be found (are you missing a using directive or an assembly reference?)
Make sure that you add a using statement for the extensions namespace:
using Microsoft.Office.Tools.Word.Extensions;
If you already did this, can you share the code where you are trying to use the extension method?
Edit:
As you can see in the image you're using Visual Studio 2008 RTM (Release To Manufacturing) version and you have not installed the Visual Studio SP1. The SP1 mentioned in the right is for the .NET Framework.
About Dialog for Visual Studio http://img337.imageshack.us/img337/9041/vs2008sp1.png
Try installing the SP1 for Visual Studio. You can download it from here.