How can I programmatically open multiple solutions in Visual Studio and start debugging them simultaneously?
You can achieve this function by calling dll. For example, I have a Project a in Solution a and a Project b in Solution b. At this time, I need to copy the Project b.dll and Project b.pdb to the Solution a\Project a\bin\Debug directory, and then call it. Please refer to the details. Debugging multiple solutions in Visual Studio
Related
I started learning c# a couple days ago and want to send my first program to my friend but as a standalone exe file that can be shared through google drive.
I've found several solutions but I coudln't understand any of them. Is there a simple solution to compile an exe file or a standalone app in visual studio 2019 that would just work when you open it
One annoying thing with .NET Core is that when you build it in Visual Studio it makes lots of separate files, which is annoying for portability.
A fix to this is to right-click on your project in Solution Explorer and click Publish. Select Folder Profile, give it a name and save it.
After that, you will need to edit the target runtime option, and set it to win-x86. After that, you should see a dropdown box at the bottom of the dialog, expand it and check 'Produce a single file'.
Then you can hit Publish and it should produce a single file.
NOTE: This does not work in .NET Framework, only .NET Core.
All you gotta do is simply build the project within Visual Studio, once that's done. Go to your projects folder and go into bin/Release (or Debug if you've selected debug build)/myprogram.exe. It should make a standalone .exe file!
Maybe this could also help you.
Official Documentation: Compiling Building in Visual Studio
I am an experienced developer who is completely new to C# and windows development.
I would like to contribute to Rocksmith custom song creator with a simple feature, but I don't even know how to build and run the project in Visual Studio 2012. I cloned the git repository, double clicked on devtools/devtools.csproj then Debug -> Start Debugging but I get an error about not being able to start a class directly.
You can browse the source code of the project at: https://code.google.com/p/rocksmith-custom-song-creator/source/browse/
From what I can tell, you have selected a sub-project in your solution to be the starting-project.
See, if there is project that defines a Window (WinForms or WPF), right-click this project and select it as starting project.
From MSDN
You can specify which project or projects within a multi-project solution Visual Studio will build and debug first.
To set a single startup project
In Solution Explorer, select the desired startup project within your solution.
On the Project menu, choose Set as StartUp Project.
The .csproj is just a project, you need to put that into a Solution (or open the solution included, if any)
Do you have a .sln file? Probably that's the one you must open.
I have Visual studio project about dataTier application, I prepared a project and in the same solution I have windows from application project.
I want to add as a reference dataTier project to Windows from project.
How can I do it?
Data tier Project in visual studio has no .exe or .dll file so I can not add it as a reference.
The Data tier Project will produce a .exe or .dll file if it compiles successfully on build. Looking in the Project Folder, you'll usually find it in the \bin\Debug or bin\Release subfolder (depending on which build configuration you've used).
But usually you don't want to add a reference in this way. If you right-click on a Project name in Visual Studio, you'll be presented with a menu which has an 'Add Reference' menu item. Click on this, then choose 'Projects' as the type of reference you want to add. You should see all other Projects which are included in the Visual Studio Solution. Just choose the one you want to reference and that's it.
EDIT: Ah, I realise now you're probably talking about the SQL Server Data Tier project type, which contains SQL scripts rather than compiled code so therefore can't be referenced by a C# project.
So, what are you actually trying to achieve here?
I am working with Add-ins for the past 10 months. I have not faced problem like this before. When I try to debug my Addin Solution in Visual Studio 2008, I get the following error.
Could anyone please help?
A project with Output Type of Class Library cannot be started directly.
In order to debug this project, add an executable project to this solution
which references the library project. Set the executable project as the
startup project.
The error makes sense, you need a hosting process for you addin, e.g. Visual Studio. I usually follow this workflow when debugging my VS addins:
Build your addin library in VisualStudio instance A.
Start VisualStudio instance B.
Load the Addin in VS instance B
In VS instance A, go to Debug | Attach to Process. Select the VS instance B process and attach your debugger.
Once you've done this you can set breakpoints etc just like any other process.
I have inherited this c# solution that includes an ix installer project (a bunch of .wxs files and some c# files). The uninstaller is generating an error message.
I haven't a clue what this installer project is. What are the .wxs files for? I can guess (and have successfully been able to fix some issues with the installer. I have figured out how the custom actions are set up and called etc.
But the bug in question would be so much easier to debug if I could step through it in the debugger - how do I do that?
Generally: How do I hook up the Visual Studio 2008 debugger with the installer project ("Set as Startup Project" is not an option in the Solution Explorer, tried that).?
Specifically: How do I debug the uninstaller? The way I see it, the uninstaller will have to use a dll not residing in the project folder (where?) and thus not really known to Visual Studio at all...
Maybe this article on MSDN will help.
I haven't done it recently but I think that if you add anywhere in the code Debugger.Break() statement, you will get a prompt during the install to debug the process and then you can step through it.
One of the pages that look promising is the WixWiki.
I found this on the wikipedia page for WiX.