Skip to main content
0 votes
0 answers
112 views

A while ago I created a small Use-ClassAccessors script and uploaded that to the PowerShell Gallery. Now I am creating another script that has a dependency on the Use-ClassAccessors script. Is there ...
iRon's user avatar
  • 24.4k
0 votes
1 answer
454 views

I'm testing with xunit on multiple frameworks (.Net 8 & .Net Core 3.1). The problem is that it keeps auto-generating this GlobalUsings file in my obj folder: // <auto-generated/> global ...
CaseyHofland's user avatar
2 votes
1 answer
591 views

I found the following code: using (var requestMessage = new HttpRequestMessage(HttpMethod.Delete, endpoint)) { ... HttpResponseMessage response = await _client.SendAsync(requestMessage); .....
David Klempfner's user avatar
2 votes
1 answer
182 views

After C# 12 (.NET 8), all types can be aliased: using A = int; using B = string; using C = Dictionary<int, string>; However, it cannot be written as using A = int; using B = string; using C = ...
raison's user avatar
  • 23
1 vote
0 answers
47 views

A file within a custom VS project template is getting altered automatically by VS when the template is used to create a project. Code in the template zip file: using Enterprise.Utilities.ServiceBase....
MajorMajorMajor's user avatar
1 vote
1 answer
79 views

I have a .NET Framework 4.7.2 web application. I am receiving the following yellow screen error from some of my Views and Partial Views but not all of them: Expected a "{" but found a "...
bowserm's user avatar
  • 1,056
0 votes
1 answer
95 views

is it necessary to use using Dispose the connection, open and close connection if using DbContext dapper in MS access database on vb.net. This is my first time using dapper, please guide me so that ...
roy's user avatar
  • 729
1 vote
1 answer
35 views

How can I identify down the call chain the encompassing using block? I mean without saving in a static or global the object created by using block nor passing it around. If I have: using(new Foo()) { ...
Gigi's user avatar
  • 330
-1 votes
1 answer
115 views

class A { TypeX PropertyX; void SomeMethod() { using (DisposableType y = new DisposableType()) { PropertyX = y.GetX(); } } } What happens to PropertyX when Y is being ...
Piglet's user avatar
  • 29.3k
1 vote
2 answers
1k views

I am working on a .NET Core project in which I need to implement a Clean Architecture Pattern. The Task is to: make an HTTP request to a third-party API service read the response content as a Stream ...
Vedran Knezevic's user avatar
0 votes
1 answer
52 views

I have using statement to close the OleDbConnection and then I'm working with the reader. I'm wondering if I have to close the reader at the end or I can rely on the using statement to close it. I've ...
zaraboy's user avatar
  • 21
11 votes
3 answers
9k views

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/using#using-declaration The lifetime of a using local will extend to the end of the scope in which it is ...
geekley's user avatar
  • 1,837
-1 votes
3 answers
273 views

using (StreamReader outFile = new StreamReader(outputFile.OpenRead())) { StreamReader resFile = new StreamReader(resultFile.OpenRead()) { //Some Codes } } Why does the above ...
Prakash sekar's user avatar
2 votes
1 answer
239 views

When combining a using statement with a fluent api that can potentially throw, the lowered code will never call dispose correctly. If I have the following class that exposes a fluent interface: public ...
David L's user avatar
  • 34.1k
0 votes
2 answers
194 views

I'm not talking about references to assemblies, rather the using statement within the code. For example what is the difference between this: using (DataReader dr = .... ) { ...stuff involving data ...
Mark Roworth's user avatar

15 30 50 per page
1
2 3 4 5
30