Infopath CodeBehind Assembly Error

1k views Asked by At

I am using Infopath 2010 + VS2010 + Sharepoint 2010.(VSTA for infopath codebehind is Visual C# 2005).

My problem is that i have used codebehind for my infopath form but my form doesnt open in sharepoint 2010 giving an error like

"The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)".

I have placed the codebehind assembly in GAC, restarted IIS, provided wrkTaskIp.aspx page with the assembly info like

"<%@ Assembly Name="LifelongblogSubmit, Version=1.0.0.0, Culture=neutral PublicKeyToken=0e5f139fbc285b37"%>", 

but still my error is on.

Anyone please suggest me what should i do to get rid off this.

2

There are 2 answers

1
Beytan Kurt On

Through the search results in google with HRESULT code of yours; there seems to be a assembly name issue there.

References: here and here

Hope it helps.

1
Jeremy F. On

Check to see where your code is being saved. Form Options --> Programming. If you are saving your code to a network drive and that drive is not available, then your code will not work since InfoPath "doesn't see" the programming location.

  1. Copy the existing code
  2. Go to Form Options --> Programming and click 'Remove Code'
  3. Browse for a location on your C:\
  4. Edit what ever object's form code
  5. Paste existing code