- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I've got the next error in VB
\Forms\03_Tools\Frm2dPublish.vb(48,5): warning BC42105: Function 'AssemblyResolve' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
1>vbc : warning BC40059: A reference was created to embedded interop assembly 'Autodesk.Inventor.Interop, Version=26.0.0.0, Culture=neutral, PublicKeyToken=d*************' because of an indirect reference to that assembly from assembly 'MCTY, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null'. Consider changing the 'Embed Interop Types' property on either assembly.
It refers to the next code Frm2dPublish
#Region "START PROGRAM"
Private Function AssemblyResolve(ByVal sender As Object, ByVal e As ResolveEventArgs) As Assembly
Dim result As System.Reflection.Assembly = Nothing
If e.Name.ToLower().Contains("grid") = True Then
result = System.Reflection.Assembly.Load(e.Name)
Return result
End If
End Function
Public Sub New()
AddHandler AppDomain.CurrentDomain.AssemblyResolve, AddressOf AssemblyResolve
' This call is required by the designer.
InitializeComponent()
_InventorApplication = StandardAddInServer.InventorApplication
_InventorApplication.SilentOperation = True
End Sub
Solved! Go to Solution.