C
C#2w ago
candrd

✅ Separate C# Dll

Hello everyone, I have a project I made in C#, but even if I change the design, the DLL changes and therefore the value I get changes. To avoid this I copied the project into the same solution and the names were the same. I changed the namespaces and made it compile as a DLL, not as an exe. But now dll project can't find the Service and Web references and I get thousands of errors that they are not defined. How do I solve this? Or can I do it in an easier way?
26 Replies
Jimmacle
Jimmacle2w ago
the DLL changes and therefore the value I get changes.
what exactly do you mean by this? yes, the DLL will change if you change its source code and rebuild that's completely normal
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
candrd
candrdOP2w ago
Project names was the same egg. Project1-Project1 for example;
Project 1
using System;

namespace first_space {
class namespace_cl {
public void func() {
Console.WriteLine("originalnamespace");
}
}
}
Project 2
using System;

namespace first_space {
class namespace_cl {
public void func() {
Console.WriteLine("copynamespace");
}
}
}
Project 1
using System;

namespace first_space {
class namespace_cl {
public void func() {
Console.WriteLine("originalnamespace");
}
}
}
Project 2
using System;

namespace first_space {
class namespace_cl {
public void func() {
Console.WriteLine("copynamespace");
}
}
}
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
candrd
candrdOP2w ago
this is a example not main project XD
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
candrd
candrdOP2w ago
np np
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
candrd
candrdOP2w ago
so the problem is, when i call the dll, vs is confusing it self and can't use the dll's functions
Jimmacle
Jimmacle2w ago
why do you have duplicate code in 2 projects?
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
candrd
candrdOP2w ago
because of the hash codes. When i change the original project hash codes changes and this time my customers cant use the program. So i found the solution this way. I separated dll by copying the main project.
Jimmacle
Jimmacle2w ago
can you start from the beginning and explain why that matters? why are you checking the hash code (file hash?) of the DLL? why can't they use it if it's different?
candrd
candrdOP2w ago
this is a project integrated with ingenico, so when i change something in my program, ingenicos hash is changing and everytime i have to contact them to update my hash code
Jimmacle
Jimmacle2w ago
if you are developing this software i'm sure you have a method in place to update the expected hashes of the files then do that, that's the right solution trying to work around security measures for what looks like a payment platform sounds like a really bad idea
candrd
candrdOP2w ago
I'm not trying to work around security measures, in fact, the changes made to the program are usually on the UI. The functions are always the same, so I don't want to make an appointment for the slightest change and waste my time. I searched the whole project but there is not such a thing like this
Jimmacle
Jimmacle2w ago
then adopt a release cycle that doesn't need you to update them so often
and everytime i have to contact them to update my hash code
this is what i meant and you are literally trying to work around a security measure that verifies the integrity of your files the solution is to follow the process the platform wants you to follow to update your code
candrd
candrdOP2w ago
actually they wanted me to do It wasn't my idea Sorry but I can't share the source code due to confidentiality agreement, i was just trying to find a solution to the problem
Jimmacle
Jimmacle2w ago
there is no good solution for what you want, you can't have ambiguous code from copying it into the project consuming the library
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
Omnissiah
Omnissiah2w ago
ok but that looks to me like you have to split the code in two dlls, one that doesn't change and is verified by ingenico and the other which is update more often you would have to find a way to make them communicate tho
MODiX
MODiX2w ago
If you have no further questions, please use /close to mark the forum thread as answered
candrd
candrdOP2w ago
yeap i'm trying to do something like this
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2w ago
If you have no further questions, please use /close to mark the forum thread as answered
candrd
candrdOP2w ago
i solved the problem thx
Want results from more Discord servers?
Add your server