What are the challenges you face when working across database platforms? Take the survey
Options

Not able to point SA to the correct assembly

tomatoma Posts: 4
edited October 31, 2011 9:00AM in SmartAssembly
Hi

I get an errormessage:
SmartAssembly has encountered an invalid symbol in xxx
[System.ComponentModel.DataAnnotations]
System.ComponentModel.DataAnnotations.EditableAttribute

The most likely cause is that SmartAssembly has used a different version of a dependency from the version used by xxxx.

Dependency found at:
c:\WINDOWS\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll

The version number of this dll SA found in the old GAC is 4.0.20506.1. That means it is from .NET Framework 4 Beta 1.

The one I need SmartAssembly to use has version number 4.0.30319.1 from .NET Framework 4.0 and it is located in the new GAC:
c:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System.ComponentModel.DataAnnotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll

It is also located here:
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.ComponentModel.DataAnnotations.dll
(This is the referenced path in VS2010 project file)

I have tried to add MandatoryPath in the project file and also tried to add the new GAC and/or other correct path to
"<DependenciesSearchPaths><SearchPath>" in SmartAssembly.settings.

Can anyone please tell me how I can force SA to use the correct dll version and not always try to use the wrong Beta 1 version in the old GAC?

kind regards
Tonny

Comments

  • Options
    I solved this myself.

    Seems like .NET Framework 4 Beta 1 put dll's in the same GAC as .NET Framework 3.5 and those was not removed when I installed the released version of .NET Framework 4. I was not able to remove the extra (Beta 1 marked as v4) assemblies through windows explorer, gacutil.exe or GACBrowser. The extra assemblies was not removed when I uninstalled .NET Framework 3.5 either.

    Found in the end that I through the "Add references" - dialog under the browse tab in Visual Studio could access and delete the extra Beta 1 assemblies. When all of them was gone SmartAssembly picked the correct assembly and worked as intended.

    kind regards
    Tonny
  • Options
    Glad you got it sorted. FYI - you can control the folders searched by SA.
    These are stored in an XML file: SmartAssembly.settings. This will be in a location like:

    C:\Program Data\Red GateSmartAssemblyThere will be an editable section that looks like:

    <DependenciesSearchPaths>
    <SearchPath>C:\Program Files (x86)\Microsoft Silverlight\4.0.50401.0</SearchPath>
    <SearchPath>D:\Removed Folder</SearchPath>
    </DependenciesSearchPaths>
    Thanks,
    James Davies
    Technical Support Engineer
    Red Gate Software
  • Options
    As you see in my first post I already tried that, and it did not work.
    Seemed like SA ignores the DependencySearchPath in the settings file if the "correct" assembly is already found in the GAC...?
  • Options
    iosubiosub Posts: 23 Bronze 1
    Hi

    I'm building a Windows Phone project with SDK 7.1

    SA is getting the reference from GAC that are wrong (It's getting the ones from SDK 7.0)
    I have try with MandatoryPath etc but it does not work, It always gets the 7.0 references instead of the 7.1

    Is there a SOLUTION?

    Thank you

    The error is:


    Error 9 SmartAssembly build failed:
    SmartAssembly has encountered an invalid symbol in MSP.Phone.dll:

    [Microsoft.Phone]Microsoft.Phone.Shell.ShellTile

    The most likely cause is that SmartAssembly has used a different version of a dependency from the version used by MSP.Phone.dll.

    If the details below are wrong, please use the MandatoryPath attribute in the .saproj file to ensure that the correct version of the dependency is found.

    Assembly containing invalid symbol: C:\MSP\2010\Dev\Dev\Phone\MSP.Phone\obj\Release\MSP.Phone.dll

    Dependency found at: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone\Microsoft.Phone.dll MSP.Phone
  • Options
    Hi

    I'm building a Windows Phone project with SDK 7.1

    SA is getting the reference from GAC that are wrong (It's getting the ones from SDK 7.0)
    I have try with MandatoryPath etc but it does not work, It always gets the 7.0 references instead of the 7.1

    I get the same result when I build.
  • Options
    You'll be pleased to know that the next version of SmartAssembly, to be released very soon, will have support for WinPhone 7.1 and Silverlight 5, and we've also fixed the MandatoryPath not working for assemblies signed with the microsoft framework key.
  • Options
    Both these issues are fixed in the SA 6.5 release candidate - http://www.red-gate.com/MessageBoard/vi ... hp?t=14201
Sign In or Register to comment.