Ошибка #1266: регистрация dll - 1Cv7 ВСД в ГИС Меркурий - КБ99 Redmine

Проект

Общее

Профиль

Ошибка #1266

регистрация dll

Добавил(а) кб99 Синявский Филипп больше 6 лет назад. Обновлено около 6 лет назад.

Статус:
Завершена
Приоритет:
Нормальный
Назначена:
-
Версия:
-
Дата начала:
11.09.2017
Срок завершения:
Готовность:

0%

Оценка временных затрат:

Описание

регистрация dll

%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe soapdll_test.dll /codebase

История

#1 Обновлено кб99 Синявский Филипп больше 6 лет назад

Рекомендуют использовать: Regasm /codebase /tlb

The /codebase option is the exact equivalent of the way you used to register COM servers with Regsvr32.exe.
You'll have to pick a specific location for the DLL and the path to that location is written to the registry. That's risky, COM servers have a strong DLL Hell problem since their registration is machine-wide. When you update that DLL then any application that uses the server will be affected. Not often in a good way, this very often breaks an app that was not recompiled to use the updated server.

.NET improves on that by being able to store multiple versions of a DLL as selected by their [AssemblyVersion]. The exact equivalent of the Windows side-by-side cache, the GAC for managed assemblies. So old apps that were not rebuilt will continue to run unaffected, still being able to use the old DLL. That's a good way.

Using /codebase is advisable when you are busy developing the server. You can skip the extra required step that registers the DLL in the GAC. Forgetting to do so is painful, your changes won't seem to work because the test app will load the old version. Regasm will display a warning when you use /codebase, warning you about the DLL Hell potential, you can ignore it.

When you let Visual Studio take care of the registration with the Project > Properties > Build tab, "Register for COM interop" checkbox then you get the exact equivalent of Regasm /codebase /tlb. It is more desirable to do it this way because it also ensures that the old version of the assembly gets unregistered, thus avoiding registry pollution. But VS has to run elevated so it can write to the registry.

https://stackoverflow.com/questions/23939699/regasm-when-is-the-codebase-option-applicable

https://docs.microsoft.com/en-us/dotnet/framework/tools/regasm-exe-assembly-registration-tool

#2 Обновлено кб99 Синявский Филипп больше 6 лет назад

  • Описание обновлено (diff)

#3 Обновлено кб99 Синявский Филипп больше 6 лет назад

рекомендуемый способ установки новой версии:

1. отмена регистрации старой dll

%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe soapdll_test.dll /unregister 

2. регистрация новой версии

%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe soapdll_test.dll /codebase

https://stackoverflow.com/questions/1718641/how-does-net-com-work-with-multiple-versions-registered-via-regasm

#4 Обновлено кб99 Синявский Филипп около 6 лет назад

  • Параметр Статус изменился с Новая на Завершена

Экспортировать в Atom PDF