Add customization for dotnet ef migrations bundle project
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
### Bug description
When running `dotnet ef migrations bundle`, a temporary project is generated to produce the executable migration bundle. During this process, NuGet performs a restore operation, and it tries to fetch vulnerability metadata from `https://api.nuget.org/v3/vulnerabilities/index.json`.
In environments without internet access (e.g. CI/CD, Docker builds), this request times out and results in the following warning:
```
/tmp/tckne5lh.xnj/efbundle.csproj : warning NU1900: Error occurred while getting package vulnerability data: The HTTP request to 'GET https://api.nuget.org/v3/vulnerabilities/index.json' has timed out after 100000ms.
Restored /tmp/tckne5lh.xnj/efbundle.csproj (in 5.12 min).
/tmp/tckne5lh.xnj/efbundle.csproj : warning NU1900: Error occurred while getting package vulnerability data: The HTTP request to 'GET https://api.nuget.org/v3/vulnerabilities/index.json' has timed out after 100000ms.
```
I haven't found a single way to disable this check.
### Your code
```csharp
FROM dotnet/sdk:8.0 AS build
WORKDIR /app
COPY ./components/back .
WORKDIR /app/src/EfMigration.DAL
ENV DOTNET_NUGET_SIGNATURE_VERIFICATION=false
RUN dotnet new tool-manifest \
&& dotnet tool install dotnet-ef -v d \
&& dotnet ef migrations bundle -v
WORKDIR /app
RUN dotnet restore EfMigration.sln
RUN dotnet build EfMigration.sln -c Release -o /app/build
......
```
### Verbose output
```text
/tmp/0bx3beiz.nzr/efbundle.csproj : warning NU1900: Error occurred while getting package vulnerability data: The HTTP request to 'GET https://api.nuget.org/v3/vulnerabilities/index.json' has timed out after 100000ms.
Restored /tmp/0bx3beiz.nzr/efbundle.csproj (in 5.13 min).
Restored /app/src/EfMigration.DAL/EfMigration.DAL.csproj (in 98 ms).
/tmp/0bx3beiz.nzr/efbundle.csproj : warning NU1900: Error occurred while getting package vulnerability data: The HTTP request to 'GET https://api.nuget.org/v3/vulnerabilities/index.json' has timed out after 100000ms.
.....
```
### EF Core version
9.0.4
### Target framework
.NET 8.0
Contributor guide
Assessment
This issue has not been assessed yet.