Visual Studio 2019 Solution does not build exe file for Windows Service Project - vb.net

Recently converted VB.NET solution from Visual Studio 2013 4.0 Framework to Visual Studio 2019 4.8 Framework. The solution contains 22 project. Of the 22 projects there is one Windows Form Application and one Windows Service project.
In Visual Studio 2013, compiling the solution would create two .exe files. One for the Windows Form project and another for the windows service project.
After converting to Visual Studio 2019 and compiling the solution, there is only one .exe file being created. That .exe file is for the Windows Form project (startup project).
When solution was being compiled using VS 2013, both .exe files would get created.
Does anyone know what I need to do to get VS 2019 to create the two .exe output files when compiling? Thanks

Related

Dotfuscator Error when integrating into VB winform Application

I am trying to integrate obfuscation into the build of a project. I am using Visual Studio 2019 CE 16.11.5 and the project is a VB winform Application targeting .net 4.6. Windows 10 Pro x64.
As soon as I add required lines into my project files and save. Visual studio unloads my project, showing the following message in output window:
error : The imported project "C:\Program Files (x86)\MSBuild\PreEmptive\Dotfuscator\6\PreEmptive.Dotfuscator.Common.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files (x86)/MSBuild/PreEmptive/Dotfuscator/6/PreEmptive.Dotfuscator.Common.targets" is correct, and that the file exists on disk.
I checked the folder in the error message and it is not there. I uninstalled and installed Dotfuscator still the required folder is not created.
I also have VS 2022 CE installed.
What am I missing?

Unable to load solution created in VS for Mac in Xamarin Studio

I am testing out the new Visual Studio for Mac, and I created a new .NET Core empty web application - was able to build and run the project.
Then I tried opening the solution with Xamarin Studio and I got the following error message:
Project file doesn't have a valid ProjectGuid
Am I trying to do something that is not possible at the moment, or am I missing some configuration?
Xamarin Studio does not support .NET Core projects created by Visual Studio for Mac.
The project file format is very different for .NET Core projects created by Visual Studio for Mac. One example is that the project does not have a GUID however there are many differences.
The DNX addin was created to support the older style .NET Core projects, which use .xproj and project.json files. Visual Studio for Mac creates the newer MSBuild SDK style project files which are .csproj files.

Why does my build app fail when run outside of VS12 (i.e. when deployed)?

I've written a c# program that builds *.csproj and *.vcxproj using Microsoft.Build.Evaluation. It works great on both project types if I compile and run it from inside Visual Studio 12. But if I run the exe directly (outside of Visual Studio) I get the example error message below. The error occurs only for vcx projects; c# projects continue to build just fine
Question: Why am I getting this error? Why does my program work fine for both C# and vcx projects when run from within VS12, but fails, but only for vcx projects, when run outside of VS12?
Please don't chastise me for not using MSBuild.exe. My orders were to programmatically build C# and vcx projects using Microsoft.Build.Evaluation.
Code:
using Microsoft.Build.Evaluation;
...
Project proj = new Project("MyCppProject.vcxproj");
proj.Build(logger);
Runtime Error:
Building MyCppProject
Project "MyCppProject.vcxproj" (default targets):
VCMessage:
ERROR C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(518,5): Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
Done building project "MyCppProject" -- FAILED.
One solution is to force the Visual Studio version as an environment variable prior to loading and building the project:
using Microsoft.Build.Evaluation;
...
Environment.SetEnvironmentVariable("VisualStudioVersion", "11.0")
Project proj = new Project("MyCppProject.vcxproj");
proj.Build(logger);
Visual studio maintains platform tool sets list supported for the version of Visual studio you are currently running for example on my machine I have VS 2008, 2010 and 2012
Now suppose when I install Visual Studio 2013 which has a Platform Toolset version of V120. What happens, is that the project saves this in its corresponding XML files in the format (vcproj, vcxproj, vcxproj.filter.user files).
now this valus is not known to VS 2012 so it complains when opened in VS 2012.
Similarly for opening VS 2012 project in VS 2010, as in your case and so on.
Solution:
To fix this issue, Open you solution file in notepad++.
Make these 2 changes
1) Replace
Format Version 12.00
with
Format Version 11.00
2) Replace
Visual Studio 2012
with
Visual Studio 2010
Then open the file again in visual studio and rebuild solution.

Upgraded WinForms project from VS2005 to VS2012. Now my ReportViewer DLLs are missing

I got a copy of a Visual Studio 2005 project from a friend. The project referenced the DLLs Microsoft.ReportViewer.Common and Microsoft.ReportViewer.WinForms. On my machine I have Visual Studio 2012. I upgraded the project. The references to these DLLs are broken, understandably, because they are Windows locations, not in the VS project. So, I want to delete the references and re-create, but I cannot find the DLLs on my machine. Do they not get installed with Visual Studio 2012? Can I download them?
I got a copy of a Visual Studio 2005 project from a friend
Which explains the problem, the target .NET version of your project is 2.0. The ReportViewer included with VS2012 requires at least 3.5.
Fix it with Project + Properties, Application tab, Target Framework combobox. You'll then find the ReportViewer control back under the "Reporting" header in the toolbox.
These have been replaced by Report Server. Though if you'd copy them over from your VS2005 machine you should still be able to use them as binary references in your solution. You can download the binaries from the MSDN Download site.
Though there should be binaries for Visual Studio 2012 as well. I suspect they will get installed when you install the SQL Server Development tools, which include the SQL Server Reporting Server components.
You can try to use the Redistributable package for Visual Studio 2010.

Way to deploy VS2010 WinForms application with SQL 2012 LocalDb with VS 2010 Installer

Is there a reference on creating a Visual Studio 2010 Installer project for a WinForms application that uses SQL 2012 LocalDb?
I'm not aware of any good reference, but it is pretty easy. The ClickOnce packages are compatible between Visual Studio 2010 and 2012, so all you'd need to do is to install Visual Studio 2012 somewhere to get the LocalDB bootstrapper (free VS 2012 Express for Desktop) and copy SqlLocalDB2012 folder from C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages (depending on your Windows installation the location could be slightly different, but should be easy to find).
Now the caveat is that to connect from .NET to LocalDB you need .NET 4.0.2 or later. I don't think there is a bootstrapper for .NET 4.0.2 anywhere. So you will either need to implement it yourself, or target .NET 4.5. You should be able to copy the .NET 4.5 bootstrapper from VS 2012 just like you can copy the LocalDB one.