VS2010 Beta2 Package doesn't load after upgrade
- Hello,
I am trying to upgrade my vs05 and vs08 package. I upgraded the project to start debugging in vs2010 as well as updated all the paths in my registry scripts. When the new experimental hive launches my package break points don't get loaded as well as none of the vsct menus are loaded. The right click actions in the solution explorer are also not showing up. Is there some "trick" I have to do. I've been reading for the past 3 hours... The following post outline part of the issue but none of them lead to a fix.
http://social.msdn.microsoft.com/Forums/en/vsxprerelease/thread/10821989-842f-4563-9dc5-87e7a8cf4352
http://social.msdn.microsoft.com/Forums/en-US/vsxprerelease/thread/ad43002b-2b17-4568-b07a-cf7cfee43caa (We CAN'T use VSIX!!!!!!!!)
Thanks
-blake
Answers
- Hi Blake,
The root cause of the "No Visual Studio registration attribute found in this assembly." error from CreatePkgDef is because you are referencing an older version of Microsoft.VisualStudio.Shell.*.dll. CreatePkgDef requires that the RegistrationAttribute classes you use are from Microsoft.VisualStudio.Shell.10.dll.
Referencing an older version (e.g. Microsoft.VisualStudio.Shell.dll) is fine, and the right thing to be doing if you want to continue to target 2005/2008. However, you'll need to change your project file to not attempt to run the CreatePkgdef tool to avoid this error. You can prevent the tool from running by adding the following to your project file inside a <PropertyGroup>:
<GeneratePkgDefFile>false</GeneratePkgDefFile>
The other issue you appear to be hitting is that "F5" doesn't work for debugging. If your project is not set up with a VSIX manifest, then our build targets will not move your binaries to the proper location for debugging, etc... in the 2010 SDK. This is by design.
The only "trick" you need to do is register your package. You can continue to register via the registry at HKLM\Microsoft\Software\VisualStudio\10.0 for VS 2010. However, this will register your package to be loaded in the "normal" (10.0) and "experimental" (10.0Exp) instances of VS. See my blog post for more details on how this works.
Hope that helps. Let us know how it goes.
Thanks,
Aaron
http://blogs.msdn.com/aaronmar- Proposed As Answer byAaron MartenMSFT, OwnerMonday, November 02, 2009 7:33 PM
- Marked As Answer byAaron MartenMSFT, OwnerWednesday, November 04, 2009 9:25 PM
All Replies
- Hello,
I started upgrading on a fresh Windows7 64bit vm and I received this error after I upgraded my solution and updated the references.
Error 1 No Visual Studio registration attribute found in this assembly. C:\Source\VisualStudio\Package\CreatePkgDef Package
I tried the following but nothing: http://blogs.msdn.com/vsxteam/archive/2009/10/15/visual-studio-2010-sdk-beta-2-readme.aspx
On a side note, how does Microsoft expect ISV's to upgrade there applications when they won't even respond to forum posts or release decent documentation... Even a blog post would be nice..
Thanks
-blake - Hello,
I also wanted to point out that on both machines the following vs2010 b2 sample that shows off VSPackages also does not work: http://code.msdn.microsoft.com/ReferenceServices
Thanks
-blake
-blake - Hi Blake,
Did you check out the Getting Started Guide? there's a section about moving extensions from 2008 to 2010.
Follow those steps and that should fix the reference/upgrade problem with the registration attributes.
-Quan - Hello,
I have followed the steps outlined in the following document(s):
http://msdn.microsoft.com/en-us/library/cc512930%28VS.100%29.aspx
file:///C:/Program%20Files%20%28x86%29/Microsoft%20Visual%20Studio%202010%20Beta2%20SDK/Getting%20Started%20with%20the%20Microsoft%20Visual%20Studio%202010%20Beta2%20SDK.htm
However, I need to follow additional specs (http://weblogs.asp.net/soever/archive/2008/06/04/use-vs2008-to-create-a-vspackage-that-runs-in-vs2008-and-vs2005.aspx) because we need the same package to load also in VS05 and VS08.
Thanks
-blake - Hi Blake,
The root cause of the "No Visual Studio registration attribute found in this assembly." error from CreatePkgDef is because you are referencing an older version of Microsoft.VisualStudio.Shell.*.dll. CreatePkgDef requires that the RegistrationAttribute classes you use are from Microsoft.VisualStudio.Shell.10.dll.
Referencing an older version (e.g. Microsoft.VisualStudio.Shell.dll) is fine, and the right thing to be doing if you want to continue to target 2005/2008. However, you'll need to change your project file to not attempt to run the CreatePkgdef tool to avoid this error. You can prevent the tool from running by adding the following to your project file inside a <PropertyGroup>:
<GeneratePkgDefFile>false</GeneratePkgDefFile>
The other issue you appear to be hitting is that "F5" doesn't work for debugging. If your project is not set up with a VSIX manifest, then our build targets will not move your binaries to the proper location for debugging, etc... in the 2010 SDK. This is by design.
The only "trick" you need to do is register your package. You can continue to register via the registry at HKLM\Microsoft\Software\VisualStudio\10.0 for VS 2010. However, this will register your package to be loaded in the "normal" (10.0) and "experimental" (10.0Exp) instances of VS. See my blog post for more details on how this works.
Hope that helps. Let us know how it goes.
Thanks,
Aaron
http://blogs.msdn.com/aaronmar- Proposed As Answer byAaron MartenMSFT, OwnerMonday, November 02, 2009 7:33 PM
- Marked As Answer byAaron MartenMSFT, OwnerWednesday, November 04, 2009 9:25 PM
- Hello,
I followed the directions above and didn't upgrade the project references. I added the following node (GeneratePkgDefFile) and then I recieved the following error which I fixed (http://social.msdn.microsoft.com/Forums/en/vsxprerelease/thread/be94c9e5-217a-4b5d-8526-078be2ff37e9). I ended up adding the source.extension.vsixmanifest because that was the only way I could get rid of the error above.
The project is set to build as .NET 3.5 and I have also updated the msbuild targets file in the project. I read your blog post and made the necessary changes but still the same old behavior. I can "debug the solution" but the package constructor or Initialize methods are never being hit and none of the vsct menus are loaded.
Thanks
-Blake Niemyjski
-blake Hi Blake,
So then the question becomes....is Visual Studio seeing your package registration. When you F5 do you see "Experimental Instance" in the title bar of the VS instance being debugged? If so, then you need to verify that your package registration is showing up properly under HKCU\Software\Microsoft\VisualStudio\10.0Exp_Config\Packages\<YourPackageGuid>.
Thanks,
Aaron
http://blogs.msdn.com/aaronmar- Hello,
When I press F5 I do see "Experimental Instance". I also see the registration info in the HKCU \Software\Microsoft\VisualStudio\10.0Exp_Config\Packages\<YourPackageGuid>.
I also know that it is not a package being auto ignored.. Any Ideas? I took a look here and checked the paths as well .
Thanks
-Blake Niemyjski
-blake What are the values in your package registration for Assembly, Codebase, and InProcServer32?
How does your package load? (i.e. Is it set to auto-load? do you expose any UI like a menu command, etc...?) Are you seeing a package load failure dialog?
The other thing to try is to run "devenv /rootsuffix Exp /log", attempt to load your package, close VS, and then check %AppData%\Microsoft\VisualStudio\10.0Exp\ActivityLog.xml. That might give some more information on what's going wrong.
Thanks,
Aaron
http://blogs.msdn.com/aaronmar- Hello,
Could I get your email address and continue this conversation via email? The implementation I can't really share detailed information in a public medium. If you are unable to do that then I can give you generic information which would only require more communication between us.
Yes, We expose menu commands via the vsct spec. Our package is set to auto load via the package class attribute. I am not seeing a package load failure, nothing in fusion log, and non of my break points are hit. I do see in the created log that it is detecting some of the extension registry data.
Thanks
-Blake Niemyjski
-blake

