我想知道哪些边缘情况可以使公共语言规范符合性.即使不打算从其他语言访问,我认为这些原则CLSCompliantAttribute是良好的最佳实践.
您是否遇到过YAGNI超过最佳实践的案例?
我需要以下的红宝石:
openssl x509 -sha1 -fingerprint -noout -in cert.pem
Run Code Online (Sandbox Code Playgroud)
我写的代码是:
data = File.read("cert.pem")
data["-----BEGIN CERTIFICATE-----\n"]=""
data["-----END CERTIFICATE-----\n"]=""
OpenSSL::Digest::SHA1.new(Base64.encode64(data))
Run Code Online (Sandbox Code Playgroud)
此代码不会生成与openssl cli命令相同的指纹.
知道我可能做错了吗?
我在StackOverflow上的另一篇文章中关注了这个链接:
这是我的WCF服务库中的app.config.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service behaviorConfiguration="TestClient.Service.Service1Behavior"
name="TestClient.Service.SearchService">
<endpoint address="" behaviorConfiguration="Sample.WsdlSampleEndpointBehavior" binding="basicHttpBinding" bindingConfiguration=""
contract="TestClient.Service.ISearchService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8731/TestClient.Service/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="Sample.WsdlSampleEndpointBehavior">
<wsdlExtensions location="http://localhost:8731/TestClient.Service/Service1/"/> …Run Code Online (Sandbox Code Playgroud)