0

I have a registry path of the following

HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins\AddinName

inside AddinName, I have a property called "LoadBehavior". I need to set this value to 3 by code whenever I execute the code.I am using Excel 2016, Can anyone help me on this?

I am unable to get access to my RegistryKey. The Registry Class is not supported for Visual Studio 2015. Is there a workaround for this?

Apeksha
  • 259
  • 1
  • 3
  • 15
  • `The Registry Class is not supported for Visual Studio 2015` - That makes no sense, it's just an IDE and you can definitely manipulate the registry with C#. Post your code and any errors you get. – Equalsk Sep 05 '17 at 19:51
  • [See this thread](https://stackoverflow.com/questions/8816178/modifying-the-registry-key-value) if you're stuck – Equalsk Sep 05 '17 at 19:51
  • @Equalsk- I already looked into that thread. My .NETFramework version is 4.5 and whenever I try to add the NuGet package for the Registry, it gives me this error- "Could not install package 'Microsoft.Win32.Registry 4.4.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0." Suggestions on any workarounds would be really helpful as I am new to this, Thank you! – Apeksha Sep 05 '17 at 20:05
  • 1
    I don't understand why you're adding a NuGet package. Just type `using Microsoft.Win32;` into your using list and then you should be able to use `RegistryKey`. Works for me on a fresh .NET 4.5 console application. – Equalsk Sep 05 '17 at 20:16

0 Answers0