Webサービスを呼び出すCLR関数をSQLServerで作成しようとしています。最初のアセンブリを作成すると、AssemblyInfo.csのAssemblyVersionは1.0。*になります。sgenを実行して、付随するXMLSerializersアセンブリを作成しますが、問題はありません。
>"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\sgen.exe" /force /assembly:Ra
elen.DemoCLRFunction.dll
Microsoft (R) Xml Serialization support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Serialization Assembly Name: Raelen.DemoCLRFunction.XmlSerializers, Version=1.0.
3868.13304, Culture=neutral, PublicKeyToken=null.
Generated serialization assembly for assembly C:\dev\freight-workspace\Raelen.De
moCLRFunction\Raelen.DemoCLRFunction\bin\Debug\Raelen.DemoCLRFunction.dll --> 'C
:\dev\freight-workspace\Raelen.DemoCLRFunction\Raelen.DemoCLRFunction\bin\Debug\
Raelen.DemoCLRFunction.XmlSerializers.dll'.
SQLServerでは、最初のアセンブリは正常に読み込まれますが、XMLSerializersアセンブリを読み込もうとすると次のエラーが発生します。
Msg 10300, Level 16, State 2, Line 7
Assembly 'Raelen.DemoCLRFunction.XmlSerializers' references assembly
'raelen.democlrfunction, version=0.0.0.0, culture=neutral, publickeytoken=null.',
which is not present in the current database. SQL Server attempted to locate and
automatically load the referenced assembly from the same location where
referring assembly came from, but that operation has failed (reason: version,
culture or public key mismatch). Please load the referenced assembly into the
current database and retry your request.
バージョン0.0.0.0を参照しようとしている理由がわかりません。それは確かにエラーの原因ですか?もしそうなら、なぜXMLSerializersアセンブリが間違ったバージョン番号を参照しているのですか?