I want to install msbuild on CentOS to run project.sln files. What are the commands for installing the same. I tried to install using "didstopia/msbuild" docker image but could not succeed.
Install the dotnet sdk for centOS.
You will be able to run msbuild files with the command dotnet msbuild or even just dotnet.
Related
I tried to install mcsema on my debian linux but I am stopped by error
Cmake 3.1 or higher is required. You are running 3.0.2. On debian this is the only version could be installed by apt-get install. Building CMake from sources, I get several errors as well. Does anyone know how to install the latest version of Cmake on Debian 8?
Download latests cmake release and follow the README.rst instructions:
UNIX/Mac OSX/MinGW/MSYS/Cygwin ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You need to have a compiler and a make installed. Run the
bootstrap script you find in the source directory of CMake. You
can use the --help option to see the supported options. You may
use the --prefix=<install_prefix> option to specify a custom
installation directory for CMake. You can run the bootstrap script
from within the CMake source directory or any other build directory of
your choice. Once this has finished successfully, run make and
make install. In summary::
$ ./bootstrap && make && make install
I have .NET Core projects I am trying to build using Travis CI on Mac and Linux using the latest Mono and .NET Core 1.0.1 tooling (MSBuild based csproj tooling). They target netstandard1.6.1, net45 and net461. The error I get from Travis CI is:
/usr/share/dotnet/sdk/1.0.1/Microsoft.Common.CurrentVersion.targets(1111,5):
error MSB3644: The reference assemblies for framework
".NETFramework,Version=v4.5" were not found. To resolve this, install
the SDK or Targeting Pack for this framework version or retarget your
application to a version of the framework for which you have the SDK
or Targeting Pack installed. Note that assemblies will be resolved
from the Global Assembly Cache (GAC) and will be used in place of
reference assemblies. Therefore your assembly may not be correctly
targeted for the framework you intend.
Does Mono not support VS 2017 MSBuild based csproj projects? How can I get my projects to build?
There are two options here, as far as I'm aware:
Use the FrameworkPathOverride environment variable as described in this issue to point to them.
Restrict your Travis build to only build against .NET Core. This is significantly simpler in my experience.
Here's the Noda Time .travis.yml file I'll be using for Noda Time when I can migrate - it's preliminary to say the least, but it does build...
language: csharp
mono: none
dotnet: 1.0.1
dist: trusty
script:
- dotnet restore src/NodaTime
- dotnet restore src/NodaTime.Test
- dotnet restore src/NodaTime.Serialization.Test
- dotnet build src/NodaTime -f netstandard1.3
- dotnet build src/NodaTime.Test -f netcoreapp1.0
- dotnet build src/NodaTime.Serialization.Test -f netcoreapp1.0
- dotnet run -p src/NodaTime.Test/*.csproj -f netcoreapp1.0 -- --where=cat!=Slow
- dotnet run -p src/NodaTime.Serialization.Test/*.csproj -f netcoreapp1.0
A few notes on this:
Unlike earlier SDKs, we now need to restore each project separately - no big "dotnet restore at the top level" :(
I was surprised when this didn't run on dist: xenial, but it didn't. (It claims the environment doesn't support .NET Core.) My guess is this will change.
We're using NUnit, and at the moment the only way of testing in the new SDK is to use NUnitLite, hence dotnet run to run tests
I'm slightly surprised I can't just specify the directory name for dotnet run (as per dotnet restore and dotnet build) but that seems to be the way of things. I'll hunt down a bug report...
In either case, I'd recommend also having a Windows-based CI build to check that everything builds and works on Windows (ideally testing each framework you support).
As of yesterday (May 5th), #dasMulli pointed out that Mono released Mono 5.0 Beta 2 (5.0.0.94) that works with .NET Core! Here is his post on dotnet/sdk#335. Here is a link to the latest beta release
My .travis.yml file looks like:
sudo: required
dist: trusty
language: csharp
solution: MySolution.sln
mono:
- beta
dotnet: 1.0.3
install:
- nuget restore MySolution.sln
- dotnet restore MySolution.sln
script:
- msbuild /t:Rebuild MySolution.sln
Mono DOES support building VS2017 .Net Framework projects as it now uses msbuild.
To get it working on Travis CI is a bit tricky but this should do the trick:
- wget -q https://packages.microsoft.com/config/ubuntu/14.04/packages-microsoft-prod.deb
- sudo dpkg -i packages-microsoft-prod.deb
- wget -q http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/gcc-5-base_5.4.0-6ubuntu1~16.04.9_amd64.deb
- sudo dpkg -i gcc-5-base_5.4.0-6ubuntu1~16.04.9_amd64.deb
- wget -q http://security.ubuntu.com/ubuntu/pool/main/g/gcc-5/libstdc++6_5.4.0-6ubuntu1~16.04.9_amd64.deb
- sudo dpkg -i libstdc++6_5.4.0-6ubuntu1~16.04.9_amd64.deb
- wget -q http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu55_55.1-7ubuntu0.4_amd64.deb
- sudo dpkg -i libicu55_55.1-7ubuntu0.4_amd64.deb
- sudo apt-get install apt-transport-https
- sudo apt-get install -y libicu55
- sudo apt-get install dotnet-runtime-deps-2.1
- sudo apt-get install dotnet-runtime-2.1
- sudo apt-get install aspnetcore-runtime-2.1
- sudo apt-get install dotnet-sdk-2.1
Basically, you need to manually install the dotnet-sdk manually and all of it's dependencies.
Then simply call msbuild:
- msbuild /p:Configuration=Release Solution.sln
.NET Framework Targeting Pack Nuget Packages
You can now build new style csproj projects with Mono on Linux by adding a NuGet package:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Build">
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
<ItemGroup Label="Package References">
<PackageReference
Include="Microsoft.NETFramework.ReferenceAssemblies"
PrivateAssets="All"
Version="1.0.0-preview.2" />
</ItemGroup>
</Project>
More information can be found on the Microsoft/dotnet GitHub page. At the time of writing it's in preview but I've found that it does work. The only gotcha I discovered is that dotnet test with xUnit projects does not work and is not a supported scenario according to the xUnit author.
Are there command line commands to install or upgrade .NET Core?
I checked to see if I had .NET Core was installed on my computer using dotnet --version only to notice that I still had the preview version installed on my computer. I was wondering if I could issue some commands to upgrade it to the latest version.
There is no dotnet command to update .Net Core. Instead, you should use the same approach you used to install it in the first place, which depends on your OS.
Not promoted officially but it looks like there are approved packages on Chocolatey for .NET Core SDK.
https://chocolatey.org/packages/dotnetcore-sdk
Example:
> choco install dotnetcore-sdk
Or:
> choco upgrade dotnetcore-sdk
Update (December 2020): For .NET 5 the chocolatey package has changed since it's not technically branded as .NET Core any longer.
https://chocolatey.org/packages/dotnet-sdk/
Example:
> choco install dotnet-sdk
Or:
> choco upgrade dotnet-sdk
If you have WinGet, then you can use it to install (or update) .NET:
winget install Microsoft.DotNet.SDK.Preview # currently .NET 7
winget install Microsoft.DotNet.SDK.6
winget install Microsoft.DotNet.SDK.5
winget install Microsoft.DotNet.SDK.3_1
Run from an admin prompt
For those who find this on search, there are dotnet-install scripts you can use. For example:
# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"
# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"
# Shell
wget https://dot.net/v1/dotnet-install.sh && chmod +x ./dotnet-install.sh && sudo ./dotnet-install.sh
* Note the default install location for these is different than the official installers; as said in another answer the easiest path to update is to use the same method you first installed with.
Edit: apt packages for Ubuntu 22.04+ now includes dotnet6 for the SDK. Other dotnet packages, such as just the runtime (dotnet-runtime-6.0, aspnet-runtime-6.0) can be installed as well.
sudo apt update
sudo apt install dotnet6
Just a heads up so you (or other people) don't struggle for hours as I did.
.NET Core 1.1.0 ships with SDK 1.0.0 Preview 2 (when this is written), but you need SDK 1.0.0 Preview 3.
Download and install .NET Core 1.1.0 as #svick suggested, then download and install SDK Preview 3 from: https://github.com/dotnet/core/blob/master/release-notes/preview3-download.md
try to run Asp.Net 5 Application through command prompt by using command
C:\asp.net5App\src\asp.net5>dnx .web
error message that I am getting.
'dnx' is not recognized as an internal or external command,
operable program or batch file.
Run dnvm upgrade.
If dnvm is not recognized, follow the instructions on the Home repo to install it, then do the previous step.
I am tied of this thread, because it has so many misleading answers that happen to work for some people and not for others. But anyway this is what worked for me.
Install visual studio 2015 (Enterprise)
open Developer Command Prompt for VS2015 and ran the following commands
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
the above installs .NET Version Manager (DNVM)
Then i cd into the folder where dnvm has been installed e.g
cd /Users/johnny/.dnx/bin
there i ran these commands
dnvm upgrade -r coreclr (To install DNX for .NET Core)
dnvm upgrade -r clr (To install DNX for the full .NET Framework)
then i ran
dnvm setup (to firmly setup the path)
then i got out of /Users/johnny/.dnx/bin and ran
where dnvm = C:\Users\johnny.dnx\bin\dnvm.cmd
dnvm = produced a batch of commands options to be used
Check that you've got an active runtime before you can use dnx.
dnvm use
I have a site I'm running off an Apache server, and I want to run a python script using the server and the web browser. I'm using xampp, and I have researched that I have to use modwsgi, and I have downloaded the zip and unpacked it onto my desktop. Now using command prompt I run
setup.py install
The first time I did this, I didn't have setup tools installed for python (I have python 2.7.8 and I'm on Windows 7 64 bit), so I went ahead and downloaded that, but now when I run the command again I get the following message
RuntimeError: The 'apxs' command appears to not to be installed or is not exectuable.
Please check the list of prerequistes in the documentation for the package and install
any missing Apache httpd server packages.
How exactly do I install apxs because I don't have Apache but xampp?
I was installing apxs on XAMPP in Windows. I wrote a blog post with the complete solution (in Spanish). I basically compiled my own version of apxs. The steps were:
Install ActiveState Perl for Windows
Add C:\xampp\apache\bin to the environment variable Path
Download apxs from here
Unzip tar.gz file in C:\xampp\apache\bin.
Execute:
ppm install dmake
cd c:\xampp\apache\bin\apxs
perl Configure.pl --with-apache2=C:\xampp\apache
--with-apache-prog=httpd.exe