dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.43k stars 10.01k forks source link

Cannot Create A DataRow Object #58077

Closed dcbrewster closed 1 month ago

dcbrewster commented 1 month ago

Is there an existing issue for this?

Describe the bug

The following code will not compile. The reported error is: 'DataRow' does not contain a constructor that takes 0 arguments. There are to arguments for DataRow.


using System.Data;

namespace Test
{
    internal class Test
    {
        private DataRow dr = new();
    }
}
~~~

### Expected Behavior

I would expect the program to compile and a DataRow object would be created when executed.

### Steps To Reproduce

**github Public Repo:** [https://github.com/dcbrewster/Testing_DataRow](https://github.com/dcbrewster/Testing_DataRow)

### Exceptions (if any)

_No response_

### .NET Version

.Net 8.0

### Anything else?

Using Visual Studio Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.11.4

Microsoft Visual Studio Community 2022
Version 17.11.4
VisualStudio.17.Release/17.11.4+35312.102
Microsoft .NET Framework
Version 4.8.09037

Installed Version: Community

Microsoft Visual Studio Tools for Applications 2022   00482-90000-00000-AA852
Microsoft Visual Studio Tools for Applications 2022

Visual C++ 2022   00482-90000-00000-AA852
Microsoft Visual C++ 2022

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

ASA Service Provider   1.0

ASP.NET and Web Tools   17.11.231.19466
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.11.231.19466
Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio   2.6.5000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   17.11.231.19466
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.6.5000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools   4.11.0-3.24460.3+5649376e0e5f5db3743a94a62b073f2cce4be5d9
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

CodeMaid   12.0
CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, R, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Entity Framework Core Power Tools   2.6
Adds useful design-time EF Core DbContext features to the Visual Studio Solution Explorer context menu.

Extensibility Message Bus   1.4.39 (main@e8108eb)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub Copilot   0.2.1653.9816
GitHub Copilot is an AI pair programmer that helps you write code faster and with less work.

Linux Core Dump Debugging   1.0.9.35103
Enables debugging of Linux core dumps.

Microsoft Azure Hive Query Language Service   2.6.5000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service   2.6.5000.0
Language service for Azure Stream Analytics

Microsoft Azure Tools for Visual Studio   2.9
Support for Azure Cloud Services projects

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio   17.11.3 (ba13144)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.5.60329.1 Commit Hash:15fce86a17f9f33e5bd7ca7ccb9b216aff149252
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   6.11.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.11.3.2442001+68650a7d94261bc56a1f4bc522c2ee35314b1abb
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.11.47.0
Microsoft SQL Server Data Tools

SQL Server Integration Services   16.0.5685.0
Microsoft SQL Server Integration Services Designer
Version 16.0.5685.0

Syncfusion ASP.NET Core Project Templates   27.1.48
Provides project templates for creating an ASP.NET Core Web Application using Syncfusion ASP.NET Core components.

Syncfusion ASP.NET MVC Project Templates   27.1.48
Provides project templates for creating ASP.NET MVC Web Applications using Syncfusion components.

Syncfusion EJ2 Web Conversion and Migration   27.1.48
Converts and migrates a web project into a Syncfusion web project.

Syncfusion Reference Manager   27.1.48
A useful add-in for adding and migrating Syncfusion Assembly References for Windows Forms, WPF, and Silverlight projects.

Syncfusion WinForms Template Studio   27.1.48
Project templates for building WinForms applications using Syncfusion WinForms components.

Syncfusion.VSExtension.Troubleshooter   27.1.48
Add-in for Troubleshooting the Syncfusion projects.

Syncfusion.WindowsForms.Package   27.1.48
Provides Item/Project Templates to add Syncfusion Windows Forms Item/Project along with corresponding configurations.

SyncfusionMenu Extension   27.1.48
SyncfusionMenu Visual Studio Extension Detailed Info

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   17.0.30715.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.11.0-3.24460.3+5649376e0e5f5db3743a94a62b073f2cce4be5d9
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Linux Development   1.0.9.35103
Visual C++ for Linux Development

Visual F# Tools   17.11.0-beta.24421.7+af2f522de602281d4ef5a7b71507c428e814c5c1
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

VSPackage Extension   1.0
VSPackage Visual Studio Extension Detailed Info

Xamarin   17.11.0.98 (d17-11@86652fe)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.11.3.11 (remotes/origin/d17-11@cdbb0a4fdd)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK   13.2.2.0 (d17-5/45b0e14)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: d9a6e87
    Java.Interop: xamarin/java.interop/d17-5@149d70fe
    SQLite: xamarin/sqlite/3.40.1@68c69d8
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d
martincostello commented 1 month ago

The compiler error is correct. DataRow does not have a parameterless constructor.

This issue is also nothing to do with ASP.NET Core.

dotnet-policy-service[bot] commented 1 month ago

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.