No Source Available

Dec 7, 2010 at 8:45 PM

When implementing Unity 2.0, (Version=2.0.414.0) I receive an error stating No Source Available.  I am using the library straight from the downloads on the Patterns & Practices page.  I have not tried to recompile them.  What am I doing wrong?  Here's the error:

Call stack Location:

Microsoft.Practices.Unity.dll!Microsoft.Practices.Unity.UnityContainer.UnityContainer() Line 48

Locating source for 'e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs'. Checksum: MD5 {8a c3 5d 38 74 60 75 9b 73 d2 8e 51 f2 9c 9c 1a}
The file 'e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs' does not exist.
Looking in script documents for 'e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs'...
Looking in the projects for 'e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs'.
The file was not found in a project.
Looking in directory 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs.
The debugger could not locate the source file 'e:\Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs'

 

Here's the code that triggered it:

Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.Practices.Unity
Imports Microsoft.Practices.Unity.Configuration

Public Class ctrlReportOptions

Private Sub ctrlReportOptions_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            Using container As IUnityContainer = New UnityContainer()
                container.LoadConfiguration()
                'container.RegisterType(Of IUnit, Unit)()

                'Dim list As UnitInfoList = container.Resolve(Of UnitInfoList)()
                'cboUIC.Properties.DataSource = list
                'cboUIC.Properties.DisplayMember = "UIC"
                'cboUIC.Properties.ShowHeader = False
            End Using
        Catch ex As Exception
            Throw ex
        End Try

    End Sub

end class

Dec 8, 2010 at 5:52 AM

I believe this is by design when you try to Step Into a code that does not exist from your solution (usually 3rd party or external assemblies), but should be ignorable and you can press F5 (continue) to proceed. What happen if you press F5? Also, ussualy a windows explorer pops out and allow you to locate where your class file is located. Does it appear on you? You can browse thru the class location and once found it your debugging should just continue and will step in on the UnityContainer.cs in your case. Hope this helps.

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com