Convert C# project to .exe (visual studio 2010) - c#

Is it possible to convert visual studio 2010 express project to .exe file? Yes I know that in Projects -> [FileName of the .sln file] -> Bin -> Debug is .exe file. But when I copy it to other directory/ hdd/ usb it do not work. My project includes .mp3 and .wav files.

You cannot just copy the exe. You need to copy all of the dependencies also. If you want to know which explicitly, you could run Fusion Log Viewer to see what is missing.

Use a compiler... like Inno Script Studio (https://www.kymoto.org/products/inno-script-studio). It's free and I've been using it for years. I'm not sure what the express version of Visual Studio has available, but I know the Visual Studio 2012 Professional version has InstallShield LE available which is very easy to use as well.

Related

Create a C++/CLI Project in visual studio 2015 with Platform toolset v120 (Visual Studio 2013)

I am using Visual Studio 2015 (Update 3) in Windows 10. I have one c++ project which is written with platform toolset v120. Now I want to use the codes of this project in my C# application. So I decide to create a C++/CLI Project (Class Library) and write a wrapper for the mentioned codes to be able to use them in my C# application. The problem is that when I change the platform toolset of my C++/CLI project to v120, the compiler give me this error:
LNK1104 cannot open file 'MSVCMRTD.lib'
But it works with the default platform toolset (v140). Please be informed that I don't have written any code in my C++/CLI project. I think one of the solutions is to install the whole Visual Studio 2013 besides 2015 version which is not a good solution. (I am not going to even try it). Any solution except installing Visual Studio 2013 would be welcome.
I found the solution and bring it here for further uses. I searched the library in my computer and add it to the "Linker -> General -> Additional Library Directories" in my project's properties.

No templates in Visual Studio 2017

After a Visual Studio 2017 (RC) installation from scratch, I can't find a standard list of templates. I'm specifically interested in the Console Application (C#) template and the Windows Form (C#) template. I'm pretty sure I'm missing one of the Individual Components. I'm not sure which one is supposed to be installed and I don't want to install all of them.
Please see my list with components installed.
You need to install it by launching the installer.
Click the "Workload" tab* in the upper-left, then check top right ".NET-Desktop Development" and hit install. Note it may modify your installation size (bottom-right), and you can install other Workloads, but you must install ".NET-Desktop Development" at least.
*as seen in comments below, users were not able to achieve the equivalent using the "Individual Components" tab.
If you have installed .NET desktop development and still you can't see the templates, then VS is probably getting the templates from your custom templates folder and not installed.
To fix that, copy the installed templates folder to custom.
This is your "installed" folder
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\ProjectTemplates
This is your "custom" folder
C:\Users[your username]\Documents\Visual
Studio\2017\Templates\ProjectTemplates
Typically this happens when you are at the office and you are running VS as an administrator and visual studio is confused how to merge both of them and if you notice they don't have the same folder structure and folder names.. One is CSHARP and the other C#....
I didn't have the same problem when I installed VS 2017 community edition at home though. This happened when I installed visual studio 2017 "enterprise" edition.
I found the path and wrote it in the options
My personal experience was that I had installed the Team Foundation Server client for 2017 first (was using it as a Proof of Concept for our QA team, while I was still using VS2015), then followed it up with Installing Visual Studio 2017 later to begin development.
What I ended up with on my Start Menu was a Visual Studio 2017 and a Visual Studio 2017 (2). The Visual Studio 2017 (2) had all the templates I was missing. Following the steps found in the First answer to this question (which were clear and easy to follow) did not fix my issue. I had thought that launching the client would upgrade to the Development Client, but it did not. I renamed it to Visual Studio Professional, and now have everything I need. Not sure if this happens to anyone else, but it was what happened to me, so I hope this helps someone.
NOTE: this topic is about installation issues with MS project templates.
I came here via a search in Google, I was looking for a missing Template option in Visual Studio 2017 File menu: in VS-2015, it was Export to Template and I used it to add my own standard Project Items.
Meanwhile, I found an answer.. my issue was not related to default templates and it does not need install things. The option Export to Template has been moved to the VS-2017 Project menu !
I had to reinstall .NET desktop development (throught Workload tab), even button was showing: Modify
After that Visual C# selection appeared :)
(And now i can use Console APP Template)
In my case, I had all of the required features, but I had installed the Team Explorer version (accidentally used the wrong installer) before installing Professional.
When running the Team Explorer version, only the Blank Solution option was available.
The Team Explorer EXE was located in:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\devenv.exe"
Once I launched the correct EXE, Visual Studio started working as expected.
The Professional EXE was located in:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"
My C++ templates were there all along, it was my C# ones that were missing.
Similar to CSharpie, after trying many modify/re-installs, oddly the following finally worked for me :
- run the installer, but un-select 'Desktop development with C++'.
- allow installer to complete
- run the installer again, and select 'Desktop development with C++'.
- allow installer to complete
In my case, I had all of the required features, but I had installed the Team Explorer version (accidentally used the wrong installer) before installing Professional.
When running the Team Explorer version, only the Blank Solution option was available.
The Team Explorer EXE was located in: "C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\devenv.exe"
Once I launched the correct EXE, Visual Studio started working as expected.
The Professional EXE was located in: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"
This solved my issue, and the reason was I had enterprise edition previously installed and then uninstalled and installed the professional edition. Team Explorer was not modified later when I moved to professional from enterprise edition.

Adding Custom menu to Visual Studio-2013

I have built a custom menu command (Launch Application1) using Visual studio SDK-13(using C# extensibility) which pops up in the 'Tools' menu of Visual studio.
Now, when I run this project a new instance of Visual studio opens up and 'Launch Application1' is shown under the 'Tools' menu of that visual studio.
The output is a '.dll' file and not an '.exe' but I want to have an installer for this, so that a simple installation can deploy this into any visual studio environment permanently. Please help!
The output of a visual studio extension - in your case a custom menu command is always a dll file, with the dll file visual studio also creates a VSIX file which is a Zip file and contains the dll and some other manifest files.
The VSIX file can directly be distributed for installation on other systems, If the correct version visual studio is installed, the extension will be installed with that.
For basic stuff you can use the VSIX as your redistributable. If you want to have a proper MSI file you can try WiX installer.

Force project AND solution upgrade from VS2010 to VS2013, not just solution file [duplicate]

Trying to open a VS 2012 solution (SLN file) explicitly in VS 2013 succeeds. Simply double-clicking it in Windows Explorer still opens it in VS 2012 instead.
I've read "Visual Studio 2012 doesn't convert vs2010 solution?" and followed the suggestion to "Save As..." the solution file.
Still it opens in VS 2012 by default.
My question:
How to change a SLN file to force it being opened in Visual Studio 2013?
The .sln file indicates the intended version as one of the early lines - for example:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
or:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
However - it can only make use of this if the default application for .sln files is the "Microsoft Visual Studio Version Selector". It is not uncommon for the default .sln application to be a specific version instead. In windows 8:
you can tell which is the default because it says "keep using":
Note that you can also force the upgrade of a .sln or .proj file by using the commandline, where devenv is the target IDE version:
devenv "MyProject.sln" /upgrade
Example:
"%programfiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" "D:\Source\MySolution.sln" /upgrade
Note that this does not open Visual Studio. An alternative is to, from within the IDE, select "Save As" for your solution file and overwrite or save the solution under new name.
Read more:
http://msdn.microsoft.com/en-us/library/w15a82ay.aspx
Seems like the OP has a working answer already ... but for me the problem was different. I had a VS 2012 solution (several actually) and wanted to convert them to 2013 (which I understand is a trivial change to the .sln file, but I wanted it done automatically in case there was some secret upgrade logic I was unaware of).
So I thought I would open it in VS2013, it would automatically upgrade as expected, and then I'd be set to double click the solution and see it in VS2013 going forward. But opening in VS2013 was NOT upgrading the solution for me automatically as expected and I could not find an explicit way to force the upgrade after opening the file in VS2013. I could work with the solution, save my changes, and close VS2013, but the .sln would remain unchanged and un-upgraded.
Turns out my problem was in how I was opening the solution ... as a habit I right click files and select "open with" to choose the program I want to use to open a file. I do this frequently. Note I am NOT talking about changing the default "open with" program but just opening a file with a specific program once. So I would right click the .sln file... open with Visual Studio 2013 ... and nothing would upgrade.
Eventually I thought to go into VS2013, then do File > Open and select the .sln file (this is foreign to me since I hardly if ever open anything this way, maybe you are the same way). Anyway that did upgrade the solution file instantly.
After upgrading, lines 2-3 of the .sln file changed from this:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
to this:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
So from my experience, to automatically update a VS2012 .sln to VS2013, you must open VS2013 and select the .sln from the File > Open dialog. Using the explorer shell to force the .sln file to open in VS2013 does not invoke the upgrade logic (apparently).
As a further note, I tested with another solution, and after making changes through Configuration Manager (which obviously "touches" the .sln file) it did upgrade a VS2012 to VS2013, even after having opened it through right-click open with.
I had a solution that had previously been upgraded from 2010 to 2013 successfully but still showed the .sln as associated with 2010.
I tested all the methods given in this thread and the only one that successfully corrected the .sln was to open Visual Studio 2013 alone, then open the solution that still was associated with 2010 in the IDE, then use the [File] > [Save (name).sln as] to overwrite the existing .sln file.
Setting the file assoc of the .sln to be the "Visual Studio version selector" made no change and the solution continued to open in 2010.
The devenv (name).sln /upgrade method made no change to my .sln file.
Hacking the raw text of the .sln file corrupted mine and it would not open at all.
To solve this issue I just changed the following lines of the .sln file:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
into these:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
The comment line is to be changed as it is parsed by the solution loader.
Update:
A better approach is to use the devenv command line as pointed in another reply, which will do it safely for you.
This may work for readers attempting to upgrade a solution file to Visual Studio 2015. (I upgraded a VS 2012 solution.)
Open the solution in VS 2015.
Add a new project to the solution. (I added a test project.)
Remove the project.
Save the solution.
You may want to delete the removed project folder at this time since step 3 did not delete it.
This worked for me when neither zumey’s nor TCC’s answers did.
EDIT
Metro Smurf had a similar, but easier answer than mine for a similar question. His steps were:
Open solution in VS 2015
Right-click solution > Add > New Solution Folder (name does not matter)
Save solution
Delete the newly added solution folder
Save solution

Why are my VSPackage menus missing?

I have been going through the process of converting a VSPackage to Visual Studio 2010 that was originally written in Visual Studio 2005 and upgraded to Visual Studio 2008. See my other recent question: Is it possible to use .ctc files in Visual Studio 2010 packages?
After realising that my CTC files could no longer be used, I converted it to the VSCT format and I can run it successfully under the debugger in the experimental version of Visual Studio. However, when I try to register the package in the Registry for the actual version of Visual Studio, none of my menus show up (everything else works, so the plugin is registered).
This is the command that I used for regpkg to generate the .reg file which I then add to the Registry:
regpkg /codebase /regfile:Package.reg Package.dll
Is there anything else that I need to do when registering the package?
Update: It seems that running with the /register flag works. What is it doing differently from the registry file?
Thanks,
Alan

Categories