Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a dotnet new iOS app on the command line on a Mac fails with a Windows path in the nuget.config file #20800

Closed
brunck opened this issue Jul 1, 2024 · 3 comments

Comments

@brunck
Copy link

brunck commented Jul 1, 2024

It's helpful to have a nuget.config file on the Windows side to shorten paths, due to the dastardly max path problem in VS for Windows. This breaks building the project on a Mac at the command line.

Building the same project in VS for Windows (paired to a Mac) works.

Steps to Reproduce

  1. dotnet new ios -n someName on a Mac
  2. Create a nuget.config file for the created project with a Windows path like C:\n
    for example:
<configuration>
  <config>
    <add key="globalPackagesFolder" value="C:\n" />
  </config>
</configuration>
  1. dotnet build
  2. or, just download and run the provided example project

Expected Behavior

The app builds with no errors.

Actual Behavior

A Failed to create CoreCLR, HRESULT: 0x80070057 error, along with a message about setting the PublishTrimmed property to false, which is disallowed in a.NET for iOS app anyway

Environment

Version information

.NET SDK version 8.0.302
Workload info: ios 17.2.8053/8.0.100 SDK 8.0.300

Example Project (If Possible)

https://github.com/brunck/reproductions/tree/master/NuGetConfigBuildError

@rolfbjarne
Copy link
Member

This looks like a bug in .NET:

$ mkdir rootdir
$ cd rootdir
$ dotnet new console
[...]
$ dotnet publish /p:PublishDir=C:
[...]
$ dotnet exec C:/rootdir.dll
Failed to create CoreCLR, HRESULT: 0x80070057

@rolfbjarne
Copy link
Member

Looks like variations of dotnet/runtime#3163 and dotnet/runtime#75387

@rolfbjarne
Copy link
Member

This issue was moved to dotnet/runtime#104402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants