projects-and-solutions

Open a VS 2005 Solution File (.sln) into memory

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 09:37:20
问题 I would like to open into memory an existing .sln file. Example of a non-working method: private Solution2 OpenSolution(string filePath) { Solution2 sln; sln.Open(filePath); return sln; } If I have an instance of Solution2 then i can call the method Open; but how can i get an instance of Solution2 ? My goal is then to get the adequate project and read some of its settings... but that's easy having access to the solution. 回答1: You can programmatically create a hidden instance of Visual Studio,

Change order of files in solution explorer

邮差的信 提交于 2019-11-28 07:29:34
问题 In Visual Studio, how do you change the order of your source files? By default, it seems that they go in alphabetical order but I want to put them in a more logical order. 回答1: You can't change the order that the Solution Explorer displays your files. If you need a more logical grouping, consider using folders and namespaces. 来源: https://stackoverflow.com/questions/5826975/change-order-of-files-in-solution-explorer

Visual studio not copying content files from indirectly referenced project

让人想犯罪 __ 提交于 2019-11-28 07:14:39
I have the following project structure: Library1 <--[project reference]-- Library2 <--[ref]-- Executable -------- -------- ---------- ContentFile .cs files .cs files .cs files All project references have CopyLocal = true. When I build the project, the ContentFile gets copied to Library2 's output directory, but not to Executable 's output directory, meaning that the executable is missing ContentFile when the application runs. Why is the content file being copied to Library2 's output directory, but not Executable 's? Is there a way to also copy it to the latter (I'd like to do that without

Linker errors between multiple projects in Visual C++

丶灬走出姿态 提交于 2019-11-28 03:01:08
问题 I have a solution with multiple projects. I have a "main" project, which acts as a menu and from there, the user can access any of the other projects. On this main project, I get linker errors for every function called. How do I avoid these linker errors? I set the project dependencies already in the "Project Dependencies..." dialog. Thanks EDIT -- I did as suggested and added the output folder to the linker's additional directories. Now, however, I get a million errors as follows: 3>msvcprtd

The Ultimate Visual Studio Solution Structure

笑着哭i 提交于 2019-11-28 02:37:00
Realizing that this could be subjective based on the project at hand, I'm looking for the "best practice" method of structuring a VS (Visual Studio) Solution. Please feel free to edit this, comment on what you think might be incorrect, suggest alternatives, etc. I'd love to see this Community Wiki grow into a great resource for people just starting with VS Solutions. Below is what I have working for me now (on my current project), however I know for a fact that there is some stuff in the wrong place. In my scenario, I'm building a Web Application using MVC 2 Please post your idea of the

How do you organise open-source Visual Studio projects with open-source dependencies?

我是研究僧i 提交于 2019-11-27 23:40:41
问题 I've started an open source MVC4 project that is using some other open source project as a dependency. I've forked the other project and will be modifying it according to my needs. The problem I'm facing is how to keep these projects depending on each other, but maintained separately. Yet people who git pull my project, would get the dependency project as well? I can slam all the related code from other project into my repository, but this way I won't be able to contribute to a fork of

How to add x64 (or Any CPU) as a build option in Visual Studio 2010 (from console application to class library)

余生颓废 提交于 2019-11-27 23:35:51
Initially, I created a console application using Mass Transit as my service bus. Recently, I switched to NServiceBus , which doesn't require you to make a console application, but a class library instead. In the project properties, I simply switched the setting that changes it from a console application to a library, but the constraint that you can only build it for x86 is still in effect. I can't change the build type to Any CPU now that it is a console application, which should now be valid. Is there any way to completely change my application to a class library so that I can run the build

Opening non-express VS projects with Visual Studio 2010 Express

不羁的心 提交于 2019-11-27 22:23:04
Is it possible to open / edit a normal Visual Studio Solution with Visual Studio Express Edition ? Yes this is possible with restrictions (not all project types are supported). You must edit the second line of sln-File. For example change " # Visual Studio 2010 " to " # Visual C# Express 2010 " This works for example for class libs or Windows Forms applications. It depends. If this normal solution includes a unit testing project for example or a load tests or a modeling project (architecture, UML), then the answer is no . Class libraries, console applications, WinForm, ASP.NET, ... should be

Copying Visual Studio project file(s) to output directory during build

怎甘沉沦 提交于 2019-11-27 20:01:55
When I build a Visual Studio project, the executable is written to the output directory specified in the projects Property Page. I have a project that has some extra files (e.g., .ini file) that are used by the program. How can I configure the project to copy the file to the output directory so that when the program runs, it has a copy of the other file in its CWD? I checked the Property Page of the file and there was nothing useful other than an option to exclude it from the build (which is disabled), and the custom-build-tool command is empty (plus it is a plain-text file that does not need

Visual Studio Project vs. Solution

↘锁芯ラ 提交于 2019-11-27 19:56:43
问题 Being new to VS, how may I think of these two concepts, what is the difference? 回答1: A solution is a container for projects, and tracks dependencies between projects. 回答2: I find some missing information in the other answers (at least for people who come from other IDEs like, say, Eclipse) . To say that a solution is a container for projects is only part of the thing. The conceptual feature of a VS project (what determines its 'granularity') is that one project produces one output : typically