How are you using the Machine.config, or are you?

前端 未结 4 1563
广开言路
广开言路 2020-12-29 11:10

For ASP.Net application deployment what type of information (if any) are you storing in the machine.config?

If you\'re not using it, how are you managing environmen

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 11:19

    I use machine.config for not just ASP.NET, but for overall config as well. I implemented a hash algorithm (Tiger) in C# and wanted it to be available via machine request. So, registered my assembly in the GAC and added the following to machine.config:

    
    
        
            
                
                    
                        
                        
                        
                    
                    
                    
                    
                    
                    
                    
                
                
                    
                
            
        
    
    

    This allows my code to look like so:

    using (var h1 = HashAlgorithm.Create("Tiger192"))
    {
       ...
    }
    

    and there's no dependency on the Jcs.Tiger.dll assembly in my code at all, hard or soft.

提交回复
热议问题