How to move a class into another package? - c#

In Visual Studio I have a lot of classes and UserControls that I have to move into another namespace. In eclipse I can do it with updating all the references automatically. In Visual Studio I couldn't find a similar function. How is this possbile in Visual Studio?

If you mean moving between assemblies:
For existing built code you should add:
[assembly:TypeForwardedTo(typeof(SomeNamespace.TheControl))]
to the original assembly (that no longer contains TheControl). Then the CLR will sort everything out for you for existing built code without having to update the references.
However, for building code you will still need to update the references; I don't think vanilla VS has that built in.

There's no such functionality provided in Visual Studio. Resharper has such feature.

Rename is supported in VS for reference update, but not file or class movements

I reccomend Resharper. It's really powerful refactoring tool fos VS. VS becomes even possible to use after installing it;) And it has tool for moving classes, methods, pulling up, pushing down, renaming and many more.

Related

Drag and drop project to references folder

(Visual Studio 2012)
Is there any way to create a solution reference by simple dragging the solution item (project) inside the other's project references folder? Like this?
http://i.snag.gy/p692V.jpg
Some kind of plugin or add in or something?
I do not know of any Visual Studio add-in or extension that does this and I did not see when when searched. I believe that it would be useful if the feature adds the dropped reference quickly with no dialogs or prompts. This would be nice if R# had this feature. Maybe suggesting this feature to M$ (for the next VS) or JetBrains would be a good idea. Also, the reference Manager in VS 2012 is much better, faster and lower-friction than in previous versions, but I can see that project references could be added much faster if this feature existed. I like the idea. You could also build the extension yourself. :-)

Include references in executable

This is for C#.
I know that I can include a COM File as a resource in my executable and then unpack it into the current directory when its needed. A com file such as LibCurlNet.
What I would like to know is if Visual C# 2010 Express provides an automated way of doing this.
Such as a simple option that I can select. I do not mean using the publisher.
I don't even think there is an automated way in Visual Studio Professional/Ultimate for doing this, let alone VS Express. You probably need to use a more manual approach, such as the one described here (but I guess you already knew that).
There is a tool for packing .NET DLL:s and native DLL:s called NETZ. Granted, I have not tried it myself, but maybe this tool can be of some help to you?

Tool like magic draw but for generate C# code

It's there a plugin for visual studio or a specific program that allows to draw an UML model and generates the classes for C#?? and more, for example Creates a repository classes from classes entities of the entity framework generates
Visual Studio has had the Class Designer built in since Visual Studio 2005, though not all versions (the Express versions don't have it).
A former co-worker swore by http://www.sparxsystems.com.au/products/ea/index.html. The generated code definitely needed some tweaking though. Or something like http://staruml.sourceforge.net/en/index.php might have plugin's to generate needed c#...or perhaps t4.

how to include XNA libraries in C# project?

I am trying to make a C# game. I want to include XNA libraries there (e.g. Microsoft.XNA.Framework.Graphics). But, if I do so, I get an error :
The type or namespace XNA doesnot exist in the namespace Microsoft.
Can anyone please help ?
First of all, check you are using the correct case, the namespace and assembly names are Xna not XNA. If that doesn't work:
You should follow the instructions here. These describe how to install (as well as some flavour of Visual Studio 2010) XNA Game Studio and to create a project using the template. Using the template project is much easier than adding the references manually.
To add a reference to the XNA assemblies, you need to right click your project in Solution Explorer in Visual Studio and select "Add Reference".
If you do not see the DLLs you are looking for, you may need to right click your project, select properties, and then ensure that the target framework is one of the flavours of the .NET 4.0 framework (for XNA 4.0).
First you should right click on the "References" folder shown (usually) at the top of the project you are working in. From here you can select add references and manually browse to the location of the XNA .DLLs.
First, you need to add a reference to the XNA binary files. Second, I recommend you start off with the Built-In Visual Studio XNA Game Template, and work from there.
To add the references manually, you'll (probably need XNA Game Studio installed) and then add references to Microsoft.Xna.Framework.dll and whatever else you need.
Personally, I still think you should start with the built-in visual studio template for a Game. Once you get a feel for it, move on to advanced concepts like embeding your game into a standard WinForm app or whatever.
In the solution explorer. Go to reference, add reference and then add th Microsoft.Xna.Framework.Xact reference 4.0 It is somewhere near the bottom if you leave it unsorted. Then you can access the Audio Engine class.
I had the same problem and then found it at the 3rd time of trying. Worked fine for me. Hope this helps.
Instead of hassling around in the references list in Visual Studio, just download the DLL from HERE, or the direct link:
https://www.dllme.com/dll/files/microsoft_xna_framework_dll.html

Remoting facilities on Visual Studio 2008

I'm toying with my first remoting project and I need to create a RemotableType DLL. I know I can compile it by hand with csc, but I wonder if there are some facilities in place on Visual Studio to handle the Remoting case, or, more specificly, to tell it that a specific file should be compiled as a .dll without having to add another project to a solution exclusively to compile a class or two into DLLs.
NOTE: I know I should toy with my first WCF project, but this has to run on 2.0.
You can get away with just calling csc.exe on the pre-build event if you don't want to mess with the .proj file directly and add build events.
None that I know of using VS 2008 at the moment.
But you might want to check out NAnt. It is made for this kind of work.

Categories