0

I have a class file, where I store common methods used in several webparts. I'm asking now, how to include this file in .wsp package?

user1428033
  • 221
  • 3
  • 13

2 Answers2

0

Maybe you should create .dll which contains needed code and deploy it in seperate .wsp package.

Greg
  • 942
  • 10
  • 18
0

Class files will not be part of the solution directly, all the code files will be compiled and will be part of the project assembly.This dll will be part of the solution package and it will be placed in the GAC when the solution is deployed.

So there is no need for you to do anything additional.

msounthar
  • 343
  • 4
  • 8
  • What happens when ProjectA and ProjectB use shared code and only ProjectA has shared code included and you want to install only ProjectB? – Greg Sep 02 '13 at 10:18
  • In that case, You can add reference of the Project A dll with common code like any other 3rd party dll to Project B like explained below, http://stackoverflow.com/questions/7521697/include-3rd-party-dll-in-the-sharepoint-project-while-packaging-the-wsp – msounthar Sep 02 '13 at 11:08
  • Of course you can but more elegant way is to create separate solution for that (in this case you include only code which is really useful, not whole ProjectA). What happens when for some reasons you don't want to maintain ProjectA no more? You move shared code to ProjectB? – Greg Sep 02 '13 at 12:00