8

I am trying to set up a continuous integration server that is on Windows, that builds .net core applications, after installing only the .net core SDK from the .net core download site, without installing Visual Studio.

The error I get when I try to build is:

C:\dev\aaa.xproj(7,3): error MSB4019: The imported project 
 "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0
 \DNX\Microsoft.DNX.Props" was not found

I have googled and found complaints about this kind of error in earlier betas but I thought that the standalone .net core tools were supposed to work with just visual studio code (or indeed any editor) and with visual studio not installed, just the .net core standalone sdk.

Is there any technique to get this to work? Interestingly the error above occurred when I ran dotnet build from the solution root directory, like this:

msbuild /v:q  /t:Build /nologo /P:Configuration=Release MySolutionWithSevenProjectsInIt.sln

The above appears to require Visual Studio to be installed to build the whole solution, so I am guessing if I need a "solution build" step instead of an individual project build step, I need visual studio?

It's odd to me that this system has msbuild installed at all, all this computer has is the .net core sdk, and a "non working" (as above) msbuild.

3
  • 3
    I think if you want to build w/o Visual Studio installed you're supposed to use dotnet and it's commands learn.microsoft.com/en-us/dotnet/articles/core/tools/…, because the dotnet cli tools are supposed to work w/o *.sln/*.csproj/*.xproj files, just based on project.json
    – Tseng
    Aug 4, 2016 at 17:17
  • Interesting. There are also some crazy warnings even when building with dotnet on a machine without VS installed. It expects full set of C/C++ libraries like MFC and so on to exist.
    – Warren P
    Aug 4, 2016 at 17:25
  • check this - stackoverflow.com/questions/34580599/…
    – Sanket
    Aug 4, 2016 at 17:52

1 Answer 1

16

Yes, you can build modern .NET (not .NET Framework) applications without Visual Studio installed, on Windows, Mac and Linux.

You need the .NET SDK installed for your platform. Double check that you have the latest version:

dotnet --version
5.0.401

Then, go into your project directory (the folder that contains your .csproj file, or a .sln file) and run:

dotnet build

or, to build in Release mode:

dotnet build -c Release
7
  • And don't try to use the MSBUILD that they installed for you. :-)
    – Warren P
    Aug 4, 2016 at 19:05
  • Yep. I think this will need an update when they go back to msbuild with .net core. Not sure how that will work. "dotnet build" will invoke msbuild, I guess.
    – Warren P
    Aug 4, 2016 at 19:46
  • I am also using the mac system and when i ran the dotnet build i got an error as follow, ........ visual studio/v15.0/Webapplications/microsoft.webaapplication.traget" was not fould. confirm that the path in the <import> ddeclaration is correct, and that the file exists on disk...
    – Pravee
    Jan 15, 2018 at 9:31
  • 1
    @Pravee You can only build cross-platform (.NET Core) projects on Mac. It sounds like that project might be an older (.NET Framework) project that will only build on Windows. See: stackoverflow.com/a/38064762/3191599 Jan 15, 2018 at 16:21
  • What about NuGet packages used? The type or namespace name 'log4net' could not be found (are you missing a using directive or an assembly reference?)
    – SerjG
    May 16, 2019 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.