Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I need to use all the classes in one project in another. I tried adding the references, clicked on the project tab but I can't see the .cs or .sln files or any other files, just the exe in the debug folder and the .vshost file and the manifest file.
What file do I need to reference in the project?
File > Open > Project/Solution > Add to Solution (A little checkbox in the file dialog) then click the .sln you want
Right mouse click on the project that needs a reference to another project --> Add Reference --> Click the checkbox(es) next to each project you wish to refer.
Once you have added your reference you will need to include the namespace "using NamespaceOfSecondProject" in the class that will use the referred project.
You need to elaborate you question - Well why would you want to have redundant classes in two projects better build a class library and reference the dll in both the projects. If at all you need to include the classes from one project to another you simply need to copy the .cs file to other project and then select project and select add existing item then select the .cs file which you wanted to add. Hope this will help.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
We have a standard company library for our WPF/C# applications. It has a large set of images. The library is a separate project in a large solution that has several projects.
When you use an image in these other projects is there a way so they are not duplicated in the projects they are used? I want them to always go back and reference the image in the library. I have tried doing the path several ways but cannot seem to get it to work.
Yes. You can add the images as a link.
In the target project
Click Add | Existing item... from the context menu of the root of the project, or a folder in the project.
Navigate to the images in your library (select any number of them).
Click on the arrow button next to Add and select Add As Link:
This will produce a chunk of XML in your target .csproj file. You can then change how you want to use the images as usual (e.g. as content, embedded, etc.) Here's an example
<ItemGroup>
<Content Include="..\ClassLibrary1\someicon.ico">
<Link>someicon.ico</Link>
</Content>
<Resource Include="..\ClassLibrary1\someimage.png">
<Link>someimage.png</Link>
</Resource>
</ItemGroup>
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I'm trying to merge multiple exe and dll files in one MSI file in order to install all of them using one installation file by using visual studio.
In addition to that I don't have the source code for the exe files. I used winx tools to have an exe file but I had the source code.
I'm guessing that you've been looking at Visual Studio setup examples that show build project output as an input to the setup project, and that's perhaps why you mention that you don't have access to the sources that would be used for the build.
The File View on Target System view in installer projects has destination folders (such as Application Folder). To add an exe or Dll just drag and drop the file into that folder, or right-click in the pane and do an Add File. Other files might go to Common Files, so again just add the files to that folder pane. Some of the time you may want to add the company name if it's not already part of the folder name.
This might help, it's old but installer projects are still like this:
https://www.red-gate.com/simple-talk/dotnet/visual-studio/getting-started-with-setup-projects/
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I want to store the assembly-version in one file for all projects in my solution.
This way it's easier to maintain the configuration.
In C# i can add links to the AssemblyInfo.cs in the project and Drag & Drop the file-link to the Properties.
This way the version is displayed correctly in Properties => Application => Assembly Information.
In VB.Net this is not possible. I can't Drop files into My Project. But this is the place where the AssemblyInfo.vb has to be placed. If it is stored in an other position, Visual Studio doesn't show it in My Project => Application => Assembly Information.
Create the link(file) in the project itself by right click Add existing item... and cut & paste the new link into the MyProject-Folder.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
In New File I can choose empty class but it does not close the project I am working on. As in the title, what is the difference between a file and a project?
One ore more files create a project and one ore more projects create a solution.
You are probably adding a new file to you're existing project.
Projects are "buildable" things (they have output) and are composed of files. Thus, adding a new file has no reason to "close" the project (whatever that means).
When you get far enough, Solutions are "groups" of projects. Adding a new project to a solution doesn't close anything either.
In any IDE, project is a logical collection of different types of files, such as programs, resources, configuration files etc. There are so many different formats for storing the project information on disk such as .xproj, .csproj etc.
A "solution" is a logical collection of projects. A solution can have just one project in that as well. Solution is stored on disk typically by .sln extension by visual studio. In a solution, programmer can specify the build order of the projects, build configurations etc.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have two projects (1-Business: where I put the Linq Classes 2-View: wpf app, where i will show data) in the same solution (ProjectOne)
the problem is that I can't call the first project in the second one even when i add references (right click on the View project -->Property-->References Path-->Select the path of the Business Project Folder )
In fact i found the solution,
first of all change the output Type of the first project from "Window Application" to "Class Library" and build it, then go to th the references of the second project and add the First one as a reference to it
You need to add a 'using' statement to the top of the class.
using ProjectOne.1-Business;
namespace ...
{
public class ...
always a good practice is cleaning the solution and then rebuilding it