简体   繁体   English

从 C# 中的各种方法创建 dll 库文件时出现问题?

[英]Problem Creating dll library file from various methods in C#?

sereenshot of my project我的项目的截图

  1. I have a problem creating dll file.我在创建 dll 文件时遇到问题。
  2. Errors of the problems are shown in picture.问题的错误如图所示。
  3. Anyone who knows the solution of the problems, help me please.任何知道问题解决方案的人,请帮助我。

Put your LoadColumn function inside of your class将您的 LoadColumn function 放入您的 class

Note that in C#, methods and variables must be declared and defined within a struct or class.请注意,在 C# 中,方法和变量必须在结构或 class 中声明和定义。 For more information on program structure in C#, see the General Structure of a C# Program article.有关 C# 中程序结构的更多信息,请参阅 C# 程序的一般结构文章。 To fix this error, rewrite your code such that all methods and fields are contained within either a struct or a class.要修复此错误,请重写您的代码,使所有方法和字段都包含在结构或 class 中。

Reference: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0116#:~:text=A%20namespace%20cannot%20directly%20contain,see%20the%20namespace%20keyword%20article .参考: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0116#:~:text=A%20namespace%20cannot%20directly%20contain,see%20the%20namespace %20关键字%20文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM