GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 2024
→
Error intitializing DotNetDelegate
Error intitializing DotNetDelegate
Iniciado por steve erts, out., 17 2017 11:07 PM - 3 respostas
Conecte-se…
steve erts
#1
Publicado em outubro, 17 2017 - 11:07 PM
Hi,
I'm trying to deploy some code that I have working on my local dev machine but when I run it on the production server. I get this error:
Error at line 24 of Global Procedure GP_MagTekOpenDevice process.
DotNetDelegate function called.
Unable to create WL.CWLDelegate_void_OnCardRequestCompleteEvent_string> object (C:\My Projects\Tourcube22 - Clean\Exe\Tourcube\Tourcube.dll assembly)
Unable to open E:\TourcubeRoot\Heritage\EXE\Tourcube.dll assembly
Error returned by .NET Framework:
Could not load file or assembly 'file:///E:\TourcubeRoot\Heritage\EXE\Tourcube.dll' or one of its dependencies. The system cannot find the file specified.
Unable to open assembly
If you look at the bolded section windev is trying for some reason to use the local path from my dev machine to create the DotNetDelegate.
Here is code that intitializes the delegate
// declare delegate
CardRequestCompleted is OnCardRequestCompleteEvent dynamic
CardRequestCompleted = DotNetDelegate(GP_MyRequestCompleted,"OnCardRequestCompleteEvent")
//register delegate
clMagtek.add_onCardRequestComplete(CardRequestCompleted)
Any idea what I'm doing wrong? How to get around this?
Thanks!
Denunciar
0
0
steve erts
#2
Publicado em outubro, 18 2017 - 1:39 AM
All my DLL's are in the EXE directory on the production server and I can run the sample code for the device I am trying to communicate with and all works fine. I can not for the life of me figure out why the error is referencing a directory path on my dev machine though. It's like the imported assembly has a reference in it somewhere that I can not see.
Denunciar
0
0
Arie
#3
Publicado em outubro, 18 2017 - 9:47 AM
Steve,
I have seen this error when the version of .NET on the target machine differs from the one the assembly is compiled for. On the other hand you say some sample code IS working okay? Using the very same tourcube.dll?
The reference to your paths is coming from Windev of course. The assembly itself cannot know this.
If I am right you also need an extra dll with the same name as your executable. Windev creates this when using .net assemblies, only pcsoft knows why.
Denunciar
0
0
steve erts
#4
Publicado em outubro, 18 2017 - 7:20 PM
Thanks Arie, your suggestion was very helpful and I was able to get my code working but I do believe there is a bug in windev and what I had to do does not really make sense.
I ended up creating a directory on my production server that had same name as my project directory on my dev machine and I put the "ghost" dll that Windev generates in there (exe name+ dll "tourcube.dll") and that got it working.
I can't imagine this is intentional but we see to be ok for now.
Denunciar
0
0
→ Voltar para WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto