1

Problem

I have a solution that contains 10+ projects. The most important being:

  • SharePoint 2013
  • WCF Service
  • Windows Service
  • Various test, Python, and Powershell related projects

I noticed that the projects contained a large number of models/classes that were repeated throughout all of the projects. To cut down on repeat code, I created a new project to house shared code. Unfortunately, I now receive this error at run-time:

"Method not found: [Name of method you tried to call]"

for any method in the shared project. It is worth noting that I have:

  • Added a reference to the new project for all project's that use it
  • This error ONLY occurs at RUNTIME

I am able to get the SharePoint solution to work if I add the shared project as an 'Additional Assembly' in the 'Package.Package' configuration file. However, this adds the shared project to the Global Assembly Cache (GAC), and still suffers from issues each time the shared project is updated.


Question

How can I deploy individual projects that reference code in the shared project without them blowing up at RunTime?


RELATED:

Community
  • 1
  • 1
Daniel Brown
  • 2,942
  • 5
  • 29
  • 41

1 Answers1

1

Methods Attempted


WCF: [RESOLVED]

  • Verify (and remove) DLL from Global Assembly Cache
  • Verified that project is "added as a reference" to WCF Project
  • Turning "Copy to Local" to true, and deploying WCF w/ other project's DLL
  • Any Assemblies the shared project relies on must also be deployed?
  • Not sure how "web.config" values are accessed/modified by shared project's classes now that it's a DLL?

See here for GAC related help: Drag and drop a DLL to the GAC ("assembly") in windows server 2008 .net 4.0


Windows Service: [RESOLVED]
  • Same steps used for WCF Service


SharePoint: [RESOLVED]
  • Open SharePoint "Package.package" file
  • Select the "Advanced Tab"
  • Under "Additional Assemblies", click "Add" and "Add assembly from project output"
  • Select the source project
  • Select "Web Application"
  • Click "Okay"

SharePoint Notes: Deploying as "Web Application" instead of "Global Assembly Cache" appears to be deprecated, but I receive the most consistent results with this option. When deploying the SharePoint Solution, the command needs an additional flag to suppress this warning:

SharePoint 2013 Management Shell:

Update-SPSolution 
-Identity [NameOfProject.wsp] 
-LiteralPath [PathToWSPToDeploy.wsp] -GACDeployment 
**-FullyTrustBinDeployment**
Community
  • 1
  • 1
Daniel Brown
  • 2,942
  • 5
  • 29
  • 41