question

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 asked ·

Issue to code

Hi,
How to resolve issue like

Severity Code Description Project File Line Suppression State
Error CS0116 A namespace cannot directly contain members such as fields or methods

due to 2nd line below?

[assemblf: AssemblyVersion("1.0.0.0")]
[assemblf: AssemblyFileVersion("1.0.0.0")]



vs-generaldotnet-visual-basicvs-debugging
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
1 Vote"
Castorix31 answered ·

Replace all the

assemblf

by

assembly

in

AssemblyInfo.cs


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

karenpayneoregon avatar image
0 Votes"
karenpayneoregon answered ·

This information belongs in (from solution explorer) and not heard of the two you mentioned.

Properties -> AssemblyInfo.cs

75980-f1.png



f1.png (93.4 KiB)
· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
How to fix it? Is it due to variable not defined properly?

0 Votes 0 ·
XingyuZhao-MSFT avatar image
1 Vote"
XingyuZhao-MSFT answered ·

Hi @Jackson1990-7147 ,

Error CS0116 A namespace cannot directly contain members such as fields or methods

Methods and variables must be declared and defined within a struct or class. Check : Compiler Error CS0116
AssemblyVersionAttribute is used to specify the version of the assembly being attributed. See : Details of Assembly version

Besides, if you need further assistance, please provide some related code here. It will help us analzye your problem.

Best Regards,
Xingyu Zhao


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 answered ·

Hi,
Can you see why issue arises, on project below?

https://1drv.ms/u/s!Ai8CrEskdewXviZDoFuhOSfP3DZi?e=foAgsI

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.