"Project not found" 和 "Object reference not set to an instance of an object" 在 Ubuntu 16.04 上使用 Rider 的 C# 项目中
"Project not found" and "Object reference not set to an instance of an object" in a C# project using Rider on Ubuntu 16.04
我刚刚在我的 Ubuntu 16.04 笔记本电脑上安装了 mono and Jetbrains 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 的屏幕截图:
我不明白这指的是什么对象,但是当我点击查看日志时,我看到了这条消息:
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.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 Whosebug question 但它对我没有帮助。任何指针都将非常受欢迎。到目前为止,我还没有弄清楚为什么需要这个 "AxImp.exe"。
您的项目中有 COM 引用。它在非 Windows 平台上不受支持。
我刚刚在我的 Ubuntu 16.04 笔记本电脑上安装了 mono and Jetbrains 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 的屏幕截图:
我不明白这指的是什么对象,但是当我点击查看日志时,我看到了这条消息:
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.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 Whosebug question 但它对我没有帮助。任何指针都将非常受欢迎。到目前为止,我还没有弄清楚为什么需要这个 "AxImp.exe"。
您的项目中有 COM 引用。它在非 Windows 平台上不受支持。