Executing a script with the same name as an included NuGet package results in System.IO.FileNotFoundException.
Steps to reproduce:
Create a new script
Add a NuGet package (e.g. Quartz)
Populate some code that leverages the package
Execute the script (execution will succeed)
Save the script with the same name as the added package (e.g. Quartz)
Execute the script (execution will fail with FileNotFoundException)
Quit NetPad
Open NetPad
Open script (e.g. Quartz)
Execute the script (execution continues to fail)
Rename script to something other than the package name (e.g. Quartz123)
Execute the script (execution will succeed)
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Quartz, Version=3.8.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4'. The system cannot find the file specified.
File name: 'Quartz, Version=3.8.0.0, Culture=neutral, PublicKeyToken=f6b8c98a402cc8a4'
Platform: Mac, arm64. .NET 8
Example script, Quartz.netpad
cb1d840b-f215-4d6f-a7f3-118e82c87f2a
{"config":{"kind":"Program","targetFrameworkVersion":"DotNet8","namespaces":["System","System.Collections","System.Collections.Generic","System.Data","System.Diagnostics","System.IO","System.Linq","System.Linq.Expressions","System.Net.Http","System.Reflection","System.Text","System.Text.RegularExpressions","System.Threading","System.Threading.Tasks","System.Xml","System.Xml.Linq","System.Xml.XPath"],"references":[{"discriminator":"PackageReference","packageId":"Quartz","version":"3.8.0","title":"Quartz.NET"}]},"dataConnection":null}
#Code
using Quartz.Core;
QuartzScheduler.VersionMajor.Dump();
Executing a script with the same name as an included NuGet package results in System.IO.FileNotFoundException.
Steps to reproduce:
Platform: Mac, arm64. .NET 8
Example script, Quartz.netpad