Has anyone got the built in .NET aspnet_regiis encryption method to work for a Windows Service? It works great for thick clients and console apps, and IIS apps. But when I try to use it from a Windows Service, it can't decrypt. I have tried running
the service as an Admin who definitely has read rights to the config file. I also tried the aspnet_regiis -pa command to grant him access to the key. Any ideas?
I know how the tool works, as I've used it on thick clients and console apps, and IIS apps. The question is whether it works on Windows Services, since I haven't found documentation saying it does or doesn't, and haven't been able to get it to work myself.
You use windows services in webpage and need to encrypt that with aspnet_reiis? I think you can do so. As aspnet_regiis only encrypt configuration sections in web.config, its no metter with Windows Service, so encrypt your configuration section in
web.config by using aspnet_reiis.
Best Regards.
Molly
It's time to start living the life you are imagined.
mttt_capgrou...
0 Points
4 Posts
Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 05, 2012 12:02 AM|LINK
Hi all,
Has anyone got the built in .NET aspnet_regiis encryption method to work for a Windows Service? It works great for thick clients and console apps, and IIS apps. But when I try to use it from a Windows Service, it can't decrypt. I have tried running the service as an Admin who definitely has read rights to the config file. I also tried the aspnet_regiis -pa command to grant him access to the key. Any ideas?
Chen Yu - MS...
All-Star
21814 Points
2513 Posts
Microsoft
Re: Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 06, 2012 06:25 AM|LINK
Hi,
The aspnet_regiis will only encrypt configuration sections - so you need to selectively encrypt those parts you need.
Please reference on below thread: http://stackoverflow.com/questions/3349551/encrypting-app-config-file
http://msdn.microsoft.com/en-us/library/k6h9cz8h(v=vs.100).aspx
Best Regards,
Feedback to us
Develop and promote your apps in Windows Store
mttt_capgrou...
0 Points
4 Posts
Re: Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 06, 2012 04:00 PM|LINK
I know how the tool works, as I've used it on thick clients and console apps, and IIS apps. The question is whether it works on Windows Services, since I haven't found documentation saying it does or doesn't, and haven't been able to get it to work myself.
molly_c
Participant
1590 Points
401 Posts
Re: Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 07, 2012 02:43 AM|LINK
You use windows services in webpage and need to encrypt that with aspnet_reiis? I think you can do so. As aspnet_regiis only encrypt configuration sections in web.config, its no metter with Windows Service, so encrypt your configuration section in web.config by using aspnet_reiis.
Molly
It's time to start living the life you are imagined.
mttt_capgrou...
0 Points
4 Posts
Re: Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 07, 2012 08:39 PM|LINK
I'm curious about Windows Services which run OUTSIDE of IIS. Not web services...
molly_c
Participant
1590 Points
401 Posts
Re: Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 10, 2012 07:31 AM|LINK
Do you have any code about this issue?
Molly
It's time to start living the life you are imagined.
mttt_capgrou...
0 Points
4 Posts
Re: Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 10, 2012 11:58 PM|LINK
Found out it was caused by a bug .
You will need to install patch KB 2548766 to decrypt them (x64 version for server). The explanation for why is here: http://blogs.msdn.com/b/tess/archive/2010/02/16/system-configuration-configurationerrosexception-unrecognized-element-setting-and-other-unrecognized-elements.aspx.
molly_c
Participant
1590 Points
401 Posts
Re: Encryption: does aspnet_regiis web.config encryption work with Windows Services?
Dec 11, 2012 12:53 AM|LINK
Oh... thanks for sharing your solution... and next time please post your error message in your problem..
Molly
It's time to start living the life you are imagined.