4

My coworker just installed Visual Studio 2017 for Mac via this link: https://www.visualstudio.com/vs/mac/. After everything was installed, he attempted to build the Asp.Net MVC C# project and got the following error:

enter image description here

Everyone else uses Windows, so we have never seen this problem before. However, I think I have found the root cause: DotNetCompilerPlatform.props's WebProjectOutputDir is null, but I haven't been able to verify this.

<KillProcess ProcessName="VBCSCompiler" ImagePath="$(WebProjectOutputDir)" /> 

Is it possible to set WebProjectOutputDir manually, or at least view its value on Mac? Why is this an issue on Mac and not Windows?

I've looked around for other answers but didn't find them helpful/relevant.

aBlaze
  • 2,436
  • 2
  • 31
  • 63

4 Answers4

9

While it is possible to build a .NET core application on a Mac (because it is cross-platform), it is not possible to build a .NET framework application on Mac (because it is Windows-specific).

Therefore, my coworker should find a Windows machine for dev.

aBlaze
  • 2,436
  • 2
  • 31
  • 63
  • 2
    It is a shame. :( I was so hopefull when I see MAC version. There is a project type as ASP.Net Web App (MVC) in MAC version. So we should be able to run it. I looks like there is a bug and they haven't solved it yet. https://developercommunity.visualstudio.com/content/problem/130218/the-killprocess-task-was-not-given-a-value-for-the.html – Deniz Öztürk Apr 29 '18 at 08:15
3

May not be the best way, but the following process worked for me:

Click on the error to open the file: Microsoft.codeDom.Providers.DotNetCompilerPlatform.props In this file replace line no 20

<KillProcess ProcessName="VBCSCompiler" ImagePath="$(WebProjectOutputDir)" />

with

<KillProcess ProcessName="VBCSCompiler" ImagePath="some right folder path in your local system" />
1

Mono goes a looooong way in running .Net code but there's quite a few gotchas. For this one, edit your csproj file and add this to one of the <PropertyGroup> sections:

<WebProjectOutputDir Condition="$(WebProjectOutputDir) == '' AND $(OS) == 'Unix' ">./</WebProjectOutputDir>
<!-- Hack for the fact that Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.8/build/net45/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props references $WebProjectOutputDir  -->

I have listed other gotchas in the link below

References

Chris F Carroll
  • 11,146
  • 3
  • 53
  • 61
0

this answer resolved my issue ASP.NET MVC project building starts failing on travis-ci

Apparently Travis-Ci switched from xbuild to msbuild as default build platform. And currently the msbuild platform does not fully support standard .NET projects on UNIX based systems only .NET core.

So a temporary workaround is to reconfigure the project to build with xbuild.

shine
  • 610
  • 3
  • 10