"未找到项目"和"对象引用未设置为对象的实例"在Ubuntu 16.04上使用Rider的C#项目中

时间:2018-05-04 15:36:16

标签: c# mono rider

我刚刚在我的Ubuntu 16.04笔记本电脑上安装了monoJetbrains Rider而且我正在尝试构建一个项目,但是我收到了这个错误:

Object reference not set to an instance of an object
  at Microsoft.Build.BackEnd.TaskExecutionHost.GetItemOutputs (Microsoft.Build.Framework.TaskPropertyInfo parameter, Microsoft.Build.Construction.ElementLocation parameterLocation) [0x00013] in <bdc5207a22bb42ae9fe3f3d07e82871e>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.GatherTaskOutputs (System.String parameterName, Microsoft.Build.Construction.ElementLocation parameterLocation, System.Boolean outputTargetIsItem, System.String outputTargetName) [0x00153] in <bdc5207a22bb42ae9fe3f3d07e82871e>:0 
  at Microsoft.Build.BackEnd.TaskBuilder.GatherTaskOutputs (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask, Microsoft.Build.BackEnd.ItemBucket bucket) [0x00180] in <bdc5207a22bb42ae9fe3f3d07e82871e>:0 
  at Microsoft.Build.BackEnd.TaskBuilder+<ExecuteInstantiatedTask>d__26.MoveNext () [0x00555] in <bdc5207a22bb42ae9fe3f3d07e82871e>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <9bbab8f8a2a246e98480e70b0839fd67>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <9bbab8f8a2a246e98480e70b0839fd67>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <9bbab8f8a2a246e98480e70b0839fd67>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <9bbab8f8a2a246e98480e70b0839fd67>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <9bbab8f8a2a246e98480e70b0839fd67>:0 
  at Microsoft.Build.BackEnd.TaskBuilder+<InitializeAndExecuteTask>d__24.MoveNext () [0x000d7] in <bdc5207a22bb42ae9fe3f3d07e82871e>:0 
--- End of stack trace from previous location where exception was thrown ---

以下是Rider的屏幕截图:enter image description here

我不明白这是指什么对象,但是当我点击查看日志时,我看到了这条消息:

Build started 5/4/2018 5:28:51 PM.
__________________________________________________
Project "/home/stian/dev/name-removed/common-util/common-util.csproj" (build target(s)):

Target ResolveComReferences:
    /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2686,5): warning MSB3084: Task attempted to find "AxImp.exe" in two locations. 1) Under the "/usr/lib/mono/4.5/" processor specific directory which is generated based on SdkToolsPath 2) The x86 specific directory under "/usr/lib/mono/4.5/" which is specified by the SDKToolsPath property. You may be able to solve the problem by doing one of the following:  1) Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK.
    /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2686,5): error MSB3086: Task could not find "AxImp.exe" using the SdkToolsPath "/usr/lib/mono/4.5/" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.7.1\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed

  Done building project "common-util.csproj" -- FAILED.

我已经看过this other Stackoverflow question,但它并没有帮助我。任何指针都会非常受欢迎。到目前为止,我还没有设法找出为什么这个&#34; AxImp.exe&#34;需要。

1 个答案:

答案 0 :(得分:1)

您的项目中有COM引用。它不支持非Windows平台。