SQL 2008 system.core and system.xml.linq registered or not?

  • Hello,

    Can anyone help me please?

    I am migrating a SQL 2005 database to SQL 2008, and trying to register CLR functionality using system.core.dll and system.xml.linq.dll omn SQL2008

    CREATE ASSEMBLY [System.Core]

    AUTHORIZATION [dbo]

    FROM 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll'

    WITH PERMISSION_SET = UNSAFE;

    Unfortunatelly I get the following error:

    Msg 6540, Level 16, State 1, Line 2

    The assembly name 'System.Core' being registered has an illegal name that duplicates the name of a system assembly.

    So i assume that the dll's are already registered and open a VB.net database project, but the references are still missing.

    Am i missing something here?

    Thanks for any help in advance.

    Paul

    😀

  • You can reference them and it be SAFE, but to do so you have to manually edit the csproj file for the project. To do this create a new VS project and save it. The Open the .csproj file or .vbproj file in Notepad. Look for the section similar to:

    <ItemGroup>

    <Reference Include="System" />

    <Reference Include="System.Data" />

    <Reference Include="System.XML" />

    </ItemGroup>

    To add the reference to System.Core and System.XML.Linq all you have to do is add the <Reference/> Node for each into the <ItemGroup></ItemGroup> section:

    <ItemGroup>

    <Reference Include="System" />

    <Reference Include="System.Data" />

    <Reference Include="System.XML" />

    <Reference Include="System.Core" />

    <Reference Include="System.Xml.Linq" />

    </ItemGroup>

    Then Save the project file, and reopen your project in Visual Studio. Wala, you now have access to System.Core and System.Xml.Linq in a SAFE Assembly.

    Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
    My Blog | Twitter | MVP Profile
    Training | Consulting | Become a SQLskills Insider
    Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply