Cannot Register Assembly

Add-in Express™ Support Service
That's what is more important than anything else

Cannot Register Assembly
 
andrew.helgeland


Guest


I've been working on a ToolBar project for a few months now in Visual Studio 2010.
We have recently decided to upgrade to Visual Studio 2012, so I uninstalled Add-in Express and re-installed it on VS2010 and VS2012.
Then I opened my project in VS2012. It builds just fine, but when I click "Register ADX Project" I get the following error:
"Cannot register assembly "pathToProject\Toolbar.dll". Exception has been thrown by the target of an invocation."

So, thinking maybe it was some conflict with it already being registered, I closed 2012, opened the project in 2010, unregistered it, closed 2010, and tried to register it in 2012. I still get the same error.

Thinking it may have been the project, I created a new toolbar project and tried to register it. I don't get the same error because now when I create a new project Visual Studio (both 2010 and 2012) fails to create the .snk file. This is an unresolved error that I've mentioned in http://www.add-in-express.com/forum/read.php?FID=10&TID=11086

It's coming time to finish up this project, so I need to resolve this issue as quickly as possible. Any suggestions?

Thanks,
Andrew
Posted 23 Oct, 2012 14:18:51 Top
andrew.helgeland


Guest


But registering the project in vs 2010 still works, by the way.
Posted 23 Oct, 2012 14:35:04 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Hello Andrew,

When generating a project, Add-in Express also generates a .snk file. To do this, it looks for the utility SN.EXE in the path specified in CurrentInstallFolder under HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows. I suppose you haven't installed some feature when installing your VS. BTW, do you have "full" VS versions or Express ones? And what is your programming language?

You can add missing features in VS installation(s) or install Windows SDK.

Hope you run VS via "Run as administrator".


Andrei Smolin
Add-in Express Team Leader
Posted 25 Oct, 2012 07:04:45 Top
andrew.helgeland


Guest


I do run VS as administrator, VS Professional, C#, .net 4.0.

The path in HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder is C:\Program Files\Microsoft SDKs\Windows\v6.0A\

In that folder, sn.exe is at bin\sn.exe.

But I also have v7.0A and v8.0A installed. Their paths are the same as above, except they are located in Program Files(x86).

Both versions of Visual Studio (2010, 2012) fail to create the .snk file. Registering an ADX project still fails in 2012.

Sorry, I know this might be a Microsoft problem, and not your problem. If so, let me know and I'll look for help elsewhere.
Posted 05 Nov, 2012 14:52:03 Top
Andrei Smolin


Add-in Express team


Posts: 18823
Joined: 2006-05-11
Andrew,

Please confirm that you explicitely use the option "Run as administrator" to start Visual Studio.

I've talked to our guys, when the wizard is run in VS 2008 and above, the .SNK file is created in this way:
- it finds the registry key HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows
- it retrieves the value CurrentInstallFolder
- Path.Combine(sdkPath, "Bin\\sn.exe")

Then SN.EXE is run to create a new .SNK file.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Nov, 2012 05:33:31 Top