SoFunction
Updated on 2025-04-06

The reason why the SuperSocket library cannot find the command in C#

In useSuperSocketIn the process of writing servers, this is a very fast development method and is also very useful. However, the learning curve is a bit high, and you often encounter various problems during use.

For example, I encountered a strange problem now. I obviously added commands to the project, but the framework cannot be found, so it is more weird.

becauseSuperSocketIt uses reflection mechanisms to find commands and is across different assembly.

thereforeSuperSocketThere are certain requirements for the discovery of commands, and the following conditions must be met:

  • 1. InheritanceCommandBasekind.
  • 2. Adoptpublicstatement.
  • 3.EXEIf it is not in the assembly, you need to add it to the parameters by yourself.

The configuration is as follows:

<?xml version="1.0" encoding="utf-8"?>


<configuration>
  

<startup>
 

   <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>


  </startup>


  <runtime>
 

 

  <gcServer enabled="true"/>


    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  

    <dependentAssembly>
   

     <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral"/>

Here's the article aboutC#insideSuperSocketThis is the article about the reason why the library cannot find the command. More relatedC# SuperSocketThe reason why the library cannot find the command is content. Please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!