Command line compiling VB.NET project via Visual Studio? - vb.net

I am trying to compile my Visual Basic .NET project named Myproject.sln via command line commands. I need to build and compile that solution.
My Visual Basic .NET compiler is called vbc.exe. Any idea how I do that thing?
I am using Visual Studio 2005 , and I have already read Microsoft's tutorial, "Building from the Command Line (Visual Basic)".

The .NET framework (version 2 and above) comes with a command line build utility called MSBuild.
You can use this to build your Visual Studio project/solution files.
From the command line:
msbuild Myproject.sln

Just run MSBuild and specify the .sln file as a command line option:
msbuild myproject.sln /p:buildmode=release

You could look at using MSBuild. That's probably the best approach.
Your .sln file is a valid MSBUild project file, so if you open the Visual Studio command prompt from the start menu and browse to your project location,
c:\...\msbuild MyFile.sln
... for example, it should just work.

Related

Open CMake proejct in Visual Studio 2019 using command line

I use Visual Studio IDE to develop, VS C++ to compile, CMake to generate the project in VS and Ninja to build.
I have a script that clone a project from git server and automate several steps I need to perform before start working on it.
At the end of this script I would like to open the project in Visual Studio. Before I used to generate the VS solution instead and then use devenv with the sln file as a parameter to open it. But now that I use VS support for CMake if I use CMakeList.txt file as a parameter it only opens this file not the complete project.
Is there a way to do what I am trying to do??
Thanks in advance.
Assuming your project's root CMakeLists.txt is located in C:\project\CMakeLists.txt you can call
devenv "C:\project"
without the CMakeLists.txt.
Note that currently there seems to be a bug in Visual Studio 16.7 that when opening a directory, all the views (e.g. solution explorer) are hidden by default. (https://developercommunity.visualstudio.com/content/problem/1140297/visual-studio-is-forgetting-docked-viewwindow-layo.html)

How to compile Visual Basic into .exe manually? [duplicate]

I am trying to compile my Visual Basic .NET project named Myproject.sln via command line commands. I need to build and compile that solution.
My Visual Basic .NET compiler is called vbc.exe. Any idea how I do that thing?
I am using Visual Studio 2005 , and I have already read Microsoft's tutorial, "Building from the Command Line (Visual Basic)".
The .NET framework (version 2 and above) comes with a command line build utility called MSBuild.
You can use this to build your Visual Studio project/solution files.
From the command line:
msbuild Myproject.sln
Just run MSBuild and specify the .sln file as a command line option:
msbuild myproject.sln /p:buildmode=release
You could look at using MSBuild. That's probably the best approach.
Your .sln file is a valid MSBUild project file, so if you open the Visual Studio command prompt from the start menu and browse to your project location,
c:\...\msbuild MyFile.sln
... for example, it should just work.

Building a msi Installer using MSbuild

I have a Dotnet Windows application built using visual studio 2015.
I am trying to automate the build using MSbuild and Jenkins.
The output files are Setup.exe & MyAppSetup.msi.
I want to use MSbuild and the VS2015 solution file, without using the VS IDE.
The Visual studio solution has 6 projects and all the projects should be built together to generate the .msi installer.
The setup.exe and .msi files are being built using the setup project file(.vdproj).
How do I build the same solution using MSBuild ?
msbuild does not have support for setup projects.
To integrate with Jenkins, you will have to use devenv (VS IDE).
Note: starting VS 2013, vdproj support is provided by an add-in.
Find more information on the following blog: https://juristr.com/blog/2014/03/Jenkins-Build-Setup-Project/

Automate publish of ClickOnce using Visual Studio 2008

I have a Visual Studio solution file (.sln), with several projects (VB.NET and C#, .vbproj, and .csproj files, respectively), and I have a Windows application, and I use ClickOnce to publish it.
Now, I need automate the Publish option using MSBuild or another good solution (cmd, VBScript, or BAT scripts).
How can I do it?
Well, ClickOnce uses MSBuild to publish itself. Therefore I would recomment to use MSBuild for your build-automation. See the reference on MSDN.
The first step is easy. You just run MSBUild with 'Publish'-target from the console. The settings made in Visual Studio are applied.
However, there are some tricky bits. For example, when you run it from the command line, the version number isn't increased. In my project I've solved this by passing the version-number from the build script.
Another tricky-part is when you want to run the build script on your build-server without Visual Studio installed. There you might have to copy some to make it work.

Compile WebSite Project with NAnt

I have a website project in Visual Studio 2008. I would like to build this website using MSBuild. I use the following command to build the solution:
msbuild.exe mysolution.sln /t:Rebuild /v:q
After I ran the command, it creates a new folder called precompiled, creates a copy of my project, removes all code files and places 1000 dll files in the bin folder.
Now when I do a "rebuild" from Visual studio, it doesn't do that.
Is there a way to rebuild the project without having it to create the precompiled folder?
Thanks
I think I found it. I should be using devenv.exe instead? How to build a .NET website using Nant