In useSuperSocket
In 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.
becauseSuperSocket
It uses reflection mechanisms to find commands and is across different assembly.
thereforeSuperSocket
There are certain requirements for the discovery of commands, and the following conditions must be met:
- 1. Inheritance
CommandBase
kind. - 2. Adopt
public
statement. - 3.
EXE
If 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#
insideSuperSocket
This is the article about the reason why the library cannot find the command. More relatedC# SuperSocket
The 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!