3

I created a custom list definition in Visual Studio. Then, I generated a .wsp and sent it to our server admin to install. He got a warning:

The solution contains no Web application scoped resource, and therefore cannot be deployed to a particular Web application. It can only be deployed globally.

Deploying this solution will place assemblies in the global assembly cache. This will grant the solution assemblies full trust. Do not procees unless you trust the solution provider.

He wants me to change the feature scope to web application. I looked, and the feature scope is currently set to web (web site).

My understanding is that list definitions need to go in the GAC ... am I wrong? If I'm right, how do I prove this to the server admin?

Edit:

My understanding is that the server administrator is trying to install to one web application only, using Install-SPSolution -Identity -WebApplication . I tried changing the scope to WebApplication, but got an error: "The project item ‘Project Name’ cannot be deployed through a Feature with WebApplication scope.”

1

If you are registring safe controls in web.config, you need to change scope to Web Application. Otherwise you can't access web.config from a site or web scoped feature.

Reference: The solution contains no Web application scoped resource

Edit

From the comments on the accepted answer to the question Explain it to me: SharePoint deployment scope, solution and features we can read the following:

Thanks. Trying to target solutions for specific web applications, but being required to deploy for all is what started this quest to understand why. It is what triggers this automatic decision by SharePoint that I'm after. Essentially, what is it about hour the feature elements are grouped into features and packaged into solutions that require the solution to be deployed to all web applications? This question, when I looked into it, quickly expanded to understanding feature scoping as well!

and

"Globally deployed" only applies to solutions that don't have web controls and web parts in them. These cannot be "Globally deployed", because the web.config of the web application you choose to deploy to is changed, i.e. entries are inserted in order to register your .dll's containing web controls and web parts. Disadvantage is that deploying solutions globally will cause all webapplications on the farm (including central administration) to be targeted and thus receive an IIS Pool recycle. Even though your solution was specifically for one web application.

Which leads us to the conclusion that you sometimes need to deploy globally even if you're only targeting on web app.

  • Hmm, I'm not registering safe controls in web.config. The only thing I'm doing is defining a list in a schema.xml file. – LFurness Jun 24 '13 at 14:29
  • @LCountee Are you installing using CASPolicies attribute or not? sharepoint.stackexchange.com/questions/70502/… – Benny Skogberg Jun 25 '13 at 11:10
  • My understanding is that the server administrator is trying to install to one web application only, using Install-SPSolution -Identity <SolutionName> -WebApplication <URLname>. I tried changing the scope to WebApplication, but got an error: "The project item ‘Project Name’ cannot be deployed through a Feature with WebApplication scope.” – LFurness Jun 25 '13 at 17:50
  • @LCountee Updated my answer with a reference to another SP.SE QnA explaining the scopes on deployment. – Benny Skogberg Jun 25 '13 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.