Search
Setup for Free
C
C#
•
3y ago
() => { return null; }
❔ Only onecompilation unit can have top-level statements.
Are you familiar with this error
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,230
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
J
Jimmacle
•
6/18/23, 2:04 AM
yes
, you have more than one file in your project using top level statements
J
Jimmacle
•
6/18/23, 2:04 AM
all your other files need their code defined in classes
(
() => { return null; }
OP
•
6/18/23, 2:05 AM
yes i got it now
(
() => { return null; }
OP
•
6/18/23, 2:05 AM
i saw that i accidentally copy pasted 2 program
.cs
(
() => { return null; }
OP
•
6/18/23, 2:05 AM
thanks mate
C
camel
•
6/18/23, 5:41 PM
What does your api message request builder do
? Looks interesting to me
C
camel
What does your api message request builder do? Looks interesting to me
(
() => { return null; }
OP
•
6/19/23, 12:03 AM
it will just return an api response
,
(
() => { return null; }
OP
•
6/19/23, 12:10 AM
it is responsible for processing the api request
, then returns back the api response
A
Accord
•
6/20/23, 12:15 AM
Was this issue resolved
? If so
, run
/close
/close
otherwise I will mark this as stale and this post will be archived until there is new activity
.
Similar Threads
✅ Only one compilation unit can have top-level statements
C
C# / help
3y ago
❔ Only one compilation unit can have top-level statements. [C# start]
C
C# / help
3y ago
❔ Only one compilation unit can have top level statements err simple explanation
C
C# / help
3y ago
Only one compilation unit can have top-level statements. [Project]csharp(CS8802) [Answered]
C
C# / help
4y ago