views:

29

answers:

1

Does anybody know how to create a .NET assembly connector programmatically? I mean I want to generate an .NET assembly in runtime using Reflection.Emit and deploy it to SharePoint.

I've found this great post:

http://www.toddbaginski.com/blog/archive/2009/12/01/how-to-programmatically-create-a-sharepoint-2010-external-content-type.aspx

where a database external type is created, but I need to create an external type based on a .NET assembly

Thanks

A: 

This is not really an answer to your question, but just an observation/suggestion. In order to deploy an assembly that SharePoint will use you have to get it in the GAC. I would think if you created some code to Emit the assembly then had either your current app or another app create a PowerShell script to add the assembly to the GAC and wire up all the SharePoint STSADM stuff, then you could accomplish what you want. I may have better ideas with more details of where you are generating the new assembly (from some external app, etc). Hope this helps or at least sparks some ideas.

pstrjds
You don't have to put an assembly in the GAC - it can also go in the BIN dir.
Ryan
True, you can place it in the bin, but then you have to put it in the bin for all servers. Either way works, there are advantages and disadvantages to each.
pstrjds