You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running 3rd party application with the latest .NET 9 build, it stops working after launching. After investigation, we found it is caused by FreeSql. The exception from Visual Studio output window is: Ambiguous match found for 'System.TimeSpan System.TimeSpan FromSeconds(Int64)'.
Reproduction Steps
Minimal Repro steps (Demo attached:ConsoleDemo.zip):
The machine has dotnet-sdk-9.0.100-preview.3.24160.1 installed.
1.Create a new net8.0 Console project.
2.Copy the following code to Program.cs.
using FreeSql;
string ConnetionString = "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=Demo;";
var freeBuilder = new FreeSqlBuilder().UseConnectionString(DataType.SqlServer, ConnetionString).Build();
Console.WriteLine(freeBuilder);
3.Install FreeSql.Provider.SqlServer nuget package.
4.Build the app.
5.Change the runtime.config file to let the app run against with dotnet-sdk-9.0.100-preview.3.24160.1.
System.TypeInitializationException: 'The type initializer for 'FreeSql.Internal.Utils' threw an exception.'
AmbiguousMatchException: Ambiguous match found for 'System.TimeSpan System.TimeSpan FromSeconds(Int64)'.
Regression?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.101: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.2.24129.7: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.3.24160.1: Fail
Description
When running 3rd party application with the latest .NET 9 build, it stops working after launching. After investigation, we found it is caused by FreeSql. The exception from Visual Studio output window is: Ambiguous match found for 'System.TimeSpan System.TimeSpan FromSeconds(Int64)'.
Reproduction Steps
Minimal Repro steps (Demo attached:ConsoleDemo.zip):
The machine has dotnet-sdk-9.0.100-preview.3.24160.1 installed.
1.Create a new net8.0 Console project.
2.Copy the following code to Program.cs.
3.Install FreeSql.Provider.SqlServer nuget package.
4.Build the app.
5.Change the runtime.config file to let the app run against with dotnet-sdk-9.0.100-preview.3.24160.1.
Expected behavior
Launch successfully.
Actual behavior
System.TypeInitializationException: 'The type initializer for 'FreeSql.Internal.Utils' threw an exception.'
AmbiguousMatchException: Ambiguous match found for 'System.TimeSpan System.TimeSpan FromSeconds(Int64)'.
Regression?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.101: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.2.24129.7: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.3.24160.1: Fail
Known Workarounds
No response
Configuration
Application Name: EasyCMS,CastIt,HyggeImaotai
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.3.24160.1
App & Source Location checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1992393
Github Link:
https://github.com/yushuo1990/EasyCMS
https://github.com/Wolfteam/CastIt
https://github.com/lisongkun/HyggeImaotai
Other information
Dotnet Info:
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: