I am working on building a new build box which I would like to contain only bare bones essentials for .NET builds. I have installed the .NET 4.0 framework and now I would like to set up a command prompt that recognizes the msbuild command.
I've tried copying over the Visual Studio Command Prompt from my machine but it is missing a lot of prereqs to initialize properly and I feel like it includes way to much stuff anyway as all I need is the msbuild command.
So, is there a way to make the windows cmd to recognize the msbuild command through possibly a batch file?
Try adding the framework tools to your Path environment variable.
Default: C:\Windows\Microsoft.NET\Framework64[version number]
It should also run just fine if you use the full path in the command line.
Figured it out, I added the location of the msbuild.exe to my Path system variable and now it works just fine.
Related
I want to name the environment in the command line when using dotnet publish. I found this solution
dotnet publish -o site /p:EnvironmentName=Production
I've never seen that /p: argument before and want to know what exactly that is. I tried to google it but because of its syntax it was hard to find anything.
I especially want to know if I can use this command also on a Linux machine in bash.
Basically, it is passed to MSBuild and sets a variable/property called EnvironmentName to a value Production. Then MSBuild scripts can read that variable when performing various tasks. It's moreless the same as setting a property in <PropertyGroup> in MSBuild script (also VisualStudio's cpsroj file).
You can see it for example here
msbuild buildapp.csproj -t:HelloWorld -p:Configuration=Release
Note that -p: syntax is the same as /p: (also -t: and /t: and so on). The former is the new one, while the latter conforms to old "DOS" way of providing command line options in Windows. For quite a couple of years many newer developer tools from Microsoft accept both ways, but the - is preferred, as it can also be used in i.e. powershell or linux, while the older / can't (or can, but cause some problems or need complicated escaping/quoting).
EDIT: ah yes, and I didn't fully answer.. The -p or /p is NOT a "windows commandline thing". In your example, this is a parameter for the dotnet program, and what I described above is true only because dotnet happens to later call into msbuild program. if you spot such -p//p parameter anywhere else, in any other application, then it may do something completely different.
Lastly, on Linux - yes, you can use it with dotnet toolset on Linux as well (net core, mono, etc) ((and I'd strongly suggest using -p: version)). However, same rules apply. As long as it is used with this app called dotnet, it will have the effect of setting environmentname during build. In any other case, or any other app, such parameter can have other meanings. It's all app-dependent, be it on Windows, or Linux.
I am developing an asp.net application on macOS with Visual Studio for Mac, and I can specify a custom run configuration.
There seems to be no way to specify a run profile, where all arguments and settings in the custom configuration are saved, instead of reentering command line arguments every time.
Is there a way to do this easily in VS for Mac? Or is that feature not available yet...
No, unfortunately you can't save it but there is workaround for this.
You get the args in the main, just change it to your configuration and put it to code when you need it.
string[] args = new[] {..}
DEVENV.exe command I am using to create build.In case solution file has issues and not properly linked to setup project .It throws error "Invalid project " error.Then it opens DEVENV.exe 's switch -help window .
"%dotNet2010%\devenv.exe" MyApp.sln /build "Release" /project "MayApp\Setup.vdproj" /Out "%LOGLOCATION%"
I guess ,This is causing long wait during automatic run and the log file not updated completely.
Any idea ,How to stop this help windows during errors?
As per the below link There is a known issue with DEVENV 2010 command.
http://connect.microsoft.com/VisualStudio/feedback/details/724272/devenv-hanging-on-cmd-line
To fix - We need to upgrade to VS2012 or hot fix need to be applied.
The hang is not happening always.
But with VS2012 devenv command - No hang and error is logged properly.
If you want to suppress all GUI windows and instead have all output redirected to the console then use DEVENV.COM instead of devenv.exe. Note the .COM extension.
For build related tasks it is recommended that you use MSBuild see MSDN Microsoft.
Here is an example of using MSBuild to build Deployment or Setup projects.
Building Visual Studio Deployment Projects With MSBuild
In either case ensure your call is to DEVENV.COM instead of DEVENV.EXE.
I've attempted to follow the instructions on deploying Qt to Windows, but I am stuck on step number 1. In it, it tells you to:
cd C:\path\to\Qt
configure -static any other options you need
Unfortunately, I can't get the Qt DOS prompt to recognize the "configure" command despite attempting to use it in virtually every folder under my Qt installation. Does anyone know where this command is store? Everything else about my project is working great with Visual Studio, but I just can't seem to figure out the deployment.
I've Googled the crap out of this and tried both the Qt and the regular Windows command prompts. Any help would be greatly appreciated!
Thanks
EDIT: For clarity, I have tried dragging all of the .dlls needed to run my program (by running it and finding the ones I get errors on), but all that happens is I stop getting errors when trying to run my app. If I double click it with the .dlls in the same folder, nothing happens at all.
Are you sure you need the static Qt build? Note that you must static build the actual Qt framework for that, and only after that you can build your application.
If yes, make sure you have the Qt source code, because configure is part of the source code of Qt, it's a tool that configure the Qt build.
The step refers to path of Qt Source directory e.g. C:\QtSDK\QtSources\\
As you can see in qt5 source tree there is a file configure.bat
You need to run that with static option, so it will configure Qt for static linking.
Then you need to re-build Qt to make your new configuration to take effect.
Is anyone using TeamCity for building their Flex apps? We're using .Net for our main site code and backend flex data calls and we use flex for our application. I have a working Ant build script, but I can't get it to run with the TeamCity Ant Runner. I'm curious if anyone has gotten this working and if they have, could I potentitially see a sample of your build script?
For some reason the build script won't pick up the FLEX_HOME environment variables for the Flex Ant Tasks.
I cannot see why it shouldn´t work. Just declare FLEX_HOME in the top of your Ant script, and point to the sdk on the TeamCity machine, like:
<property name="FLEX_HOME" value="c:/adobe/flex/sdk/3.3"/>
On a previous project I worked on we had exactly the same situation as you and it can work. I can't remember doing anything special to get this going although we may have had to manually set some environment variables in the TeamCity config. Check out the TeamCity docs for how to set these and how to they are used
You might also try using the basic Command line runner to see if that works. When troubleshooting environment variable issues in TeamCity I have found it useful to have part of the build process run a DOS set command (env for Linux) and then look in the build logs to see what the actual environment is.