dotnet / dotnet/fsharp

fsi bug after .NET 9 update: non-HTTPS sources in nuget.config creates error even with allowInsecureConnections="true" config

Open
#18,424 5 comments 0 reactions 1 assignee Claimed by @KevinRansom View on GitHub
Area-FSI Bug Impact-Low Regression
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

fsi bug after .NET 9 update: non-HTTPS sources in nuget.config creates error even with allowInsecureConnections="true" config

**Repro steps**

Provide the steps required to reproduce the problem:
1. Install .Net 9, and use it. You can create a global.json file:
```
{
"sdk": {
"version": "9.0.200"
}
}
```
2. create a nuget.config file like this:
```












```

As you see, we have an http source, and allowInsecureConnections config to disable error.

2. Open fsi interactive shell with `dotnet fsi`
3. import a package in dotnet fsi shell: write `#r "nuget: Newtonsoft.Json, 13.0.3";;` and hit enter
4. You will see this error:
```
#r "nuget: Newtonsoft.Json, 13.0.3";;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

stdin(1,1): error FS0999: C:\Users\sahin52\.packagemanagement\nuget\Projects\29652--10448b10-2f06-45aa-a84a-8674d6d8f5d7\Project.fsproj : error NU1302: You are running the 'restore' operation with an 'HTTP' source: http://mynugetsource.com/v3/index.json. NuGet requires HTTPS sources. To use an HTTP source, you must explicitly set 'allowInsecureConnections' to true in your NuGet.Config file. Refer to https://aka.ms/nuget-https-everywhere for more information.
```

**Expected behavior**

This should work like in the older .net version. Import the package. The package isnt even in that non-https source.

**Actual behavior**

I am unable to have a non-https nuget source in my nuget.config file. Imports create error

**Known workarounds**

Removing that non-https source from nuget.config while using fsi scripts

**Related information**

* Operating system: Windows 11
* .NET Runtime: .NET Core
* Editing Tools: Powershell CLI

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.