Trent,
I think I went off the rails a few steps back.
Because we already had a clsEnums project, I just extended that instead of starting with a new SQL CLR project. We don't use DDT, so I added the assembly and functions int SQL Server manually. The steps I used are as follows:
create assembly SystemWindowsForms from 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll' with PERMISSION_SET = UNSAFE
go
create assembly SystemWeb from 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll' with PERMISSION_SET = UNSAFE
go
create assembly MicroFourStrataFrameBase from 'C:\Program Files\MicroFour\StrataFrame\Assemblies\MicroFour StrataFrame Base.dll' with PERMISSION_SET = UNSAFE
go
create assembly MyEnumAssembly from 'C:\development\TMS Redevelopment\TMS\UtilEnums\bin\Debug\UtilEnums.dll' with PERMISSION_SET = UNSAFE
go
create Function GetEnumNameDeviceTypes(@value int) returns nvarchar(50) as external name [MyEnumAssembly].[UtilEnums.clsEnum].[GetEnumNameDeviceTypes]
go
At this point I was able to run the following in a query
SELECT
[TMS201].[dbo].[GetEnumNameDeviceTypes] (1)which gave the result "Scale" whereas the localised version should be "Scale." (notice period at the end to show the difference between the key and localised value).
Is this lack of localisation simply because runing the function in a Query window, there is no context that allows the function to know its language, and therefore it returns the key instead of the localisation? Would I have better luck if I called it from a stored procedure that was launched from a strataframe program?
At this point I re-read your advice and saw that I should have started with a SQL CLR project, so I started one of them and copied the code from earlier into it, and got errors about invalid references as expected. When I went to add references only the Projects Tab, which was empty, and an SQL Server Tab which had the message "The connection to the database failed for the following reason: There is no available SQL server connection. No server references can be added at this time, but you may continue to develop", were available. So how do I go about adding the references I need?
Thanks for your patience
Peter