maui icon indicating copy to clipboard operation
maui copied to clipboard

Caught exception in StartHotReloadAsync at 186: System.ArgumentNullException: Value cannot be null. (Parameter 'path1')

Open tugbadokumaci opened this issue 1 year ago • 2 comments

Description

I have a solution. Under that, I have mobile, api and shared projects. When I run my api project and my mobile project at the same time, I get this error. hot reload does not work. This error does not appear when I run the mobile project alone.

Steps to Reproduce

Run the QrCodeApp.Api and QrCodeApp.Mobile projects as multiple projects. You will immediately get this error.

Link to public reproduction project repository

https://github.com/tugbadokumaci/qr-code-app

Version with bug

7.0.101

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Caught exception in StartHotReloadAsync at 186: System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.ArgumentNullException.Throw(String paramName)
   at System.IO.Path.Combine(String path1, String path2)
   at MonoDevelop.Core.FilePath.Combine(FilePath path) in /Users/runner/work/1/s/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs:line 312
   at Xamarin.ProjectSystem.Apple.Mobile.AppleMobileProjectState.GetCompiledOutputPathAsync(String configurationName, ExecutionTarget target) in /Users/runner/work/1/s/MonoDevelop.IPhone/MonoDevelop.IPhone/ProjectSystem/AppleMobileProjectState.cs:line 323
   at Xamarin.HotReload.VSMac.VSMacManager.GenerateVSMProjectFromSingleProjectAsync(DotNetProject project, SoftDebuggerSession debuggerSession, Boolean isDevice, SingleProjectConfiguration configuration) in /Users/runner/work/1/s/HotReload/Source/Xamarin.HotReload.VSMac/VSMacManager.cs:line 209
   at Xamarin.HotReload.VSMac.VSMacManager.StartHotReloadAsync(DotNetProject project, SoftDebuggerSession debuggerSession) in /Users/runner/work/1/s/HotReload/Source/Xamarin.HotReload.VSMac/VSMacManager.cs:line 177
   at System.ArgumentNullException.Throw(String paramName)
   at System.IO.Path.Combine(String path1, String path2)
   at MonoDevelop.Core.FilePath.Combine(FilePath path) in /Users/runner/work/1/s/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs:line 312
   at Xamarin.ProjectSystem.Apple.Mobile.AppleMobileProjectState.GetCompiledOutputPathAsync(String configurationName, ExecutionTarget target) in /Users/runner/work/1/s/MonoDevelop.IPhone/MonoDevelop.IPhone/ProjectSystem/AppleMobileProjectState.cs:line 323
   at Xamarin.HotReload.VSMac.VSMacManager.GenerateVSMProjectFromSingleProjectAsync(DotNetProject project, SoftDebuggerSession debuggerSession, Boolean isDevice, SingleProjectConfiguration configuration) in /Users/runner/work/1/s/HotReload/Source/Xamarin.HotReload.VSMac/VSMacManager.cs:line 209
   at Xamarin.HotReload.VSMac.VSMacManager.StartHotReloadAsync(DotNetProject project, SoftDebuggerSession debuggerSession) in /Users/runner/work/1/s/HotReload/Source/Xamarin.HotReload.VSMac/VSMacManager.cs:line 177

tugbadokumaci avatar Jan 04 '24 18:01 tugbadokumaci

Thanks for the issue report @tugbadokumaci! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.

ghost avatar Jan 05 '24 00:01 ghost

Stepping through the code, I believe the underlying fault is a regression (or at least a change of functionality) with VS For Mac. If you set up multiple startup projects, and if one of those projects isn't a deployable mobile one, it would return an empty value for a path, so it would be ignored. Now it's throwing inside of VSMac itself.

Regardless, it's a Visual Studio issue, it can't be fixed in this repo.

drasticactions avatar Jan 05 '24 00:01 drasticactions