English 中文(简体)
How do I deploy an Asp.net web application to a Sharepoint 2010 site using WSP
原标题:

Suppose I created a custom web application that consists of:

  • several assembly DLLs: web app, business logic, data services
  • multiple aspx pages and ascx custom controls that use them
  • custom configuration section
  • custom HTTP module

More or less the usual stuff.

I would like to deploy it to a particular sharepoint site under a certain subfolder. So if I access my sharepoint site via http://myserver:90/ (because I m not using sites/some_site) I d like my application to be available under http://myserver:90/webapp

I could manually add a virtual folder (not application because I would need to access some Sharepoint site s data) to my sharepoint site in IIS and manually edit site s web.config file to register my HTTP module and add my custom configuration section as well either putting my DLLs into GAC or put them in the _app_bin (so I don t have problems with CAS), but I don t think that s a good thing to do, because this web application may get deployed in an environment where this shouldn t/couldn t be possible.

So I figured I could build a WSP using Visual Studio 2010 and deploy it that way. But I don t have enough experience doing that.

I created a new sharepoint 2010 project. Is there a way I could add all non-executable application files (aspx, ascx) at once? I ve seen the advanced tab of the WSP package where I can add my DLLs either to bin folder or GAC. I don t know whether I would also have to add any safe control and register certain classes?

So I suppose I need some pretty detailed and explanatory guidance here.

最佳回答

The only real way to do this would be to use the layouts folder to deploy your application via the wsp. This will let you depot any files that you would normally deploy with a.web application.

There are couple of problems however. The URL for your application will be http://SharePoint/somesite/_layouts/yourapp

This is a blessing and a curse. Your urls will be ugly but they will work under every SharePoint site. If your application depends on SharePoint context to function, that context will automatically be available based on the requesting URL.

To add a layouts folder under your share point project right click on the project and add a mapped folder to layouts. I would also recommend adding a sub folder under layouts for your application so that your application files don t conflict with the default files directly in the layouts folder.

For the http module, or any web.config modifications, you can use the spwebconfigmodification class.

Heres a walkthru: http://sharepointsolutions.blogspot.com/2006/12/using-spwebconfigmodificat_116736917110571614.html

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签