473,770 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Binary Compatibility in .NET

In Visual Basic 6.0, there was a setting for DLL's that would prevent a
developer from breaking binary compatibility of a DLL by changing a function
name, parameters, etc. Warnings would appear at compile time.

Is there any such thing in .NET? I can't seem to find the same type of
setting, but I do want a way to prevent developers from changing signatures
of functions.

Thanks,
Dave P.
Nov 21 '05 #1
2 2998
"DaveP" <Da***@discussi ons.microsoft.c om> wrote in message
news:06******** *************** ***********@mic rosoft.com...
In Visual Basic 6.0, there was a setting for DLL's that would prevent a
developer from breaking binary compatibility of a DLL by changing a
function name, parameters, etc. Warnings would appear at compile time.

Is there any such thing in .NET?


Guess what? There isn't!
(At least not that I've found, after a /lot/ of digging).

VB.Net will compile just whatever you tell it to, and doesn't give a
d*** that you might have just redefined every single method!

Interfaces go /some/ way to protecting against this; you publish (and
fix) the Interface; other Developers implement them. The down side
is that if you actually need to /change/ the Interface, you either have
to get into Assembly Versioning, or you have to rebuild absolutely
*everything* that implements the Interface against the new one.

The only other way /I've/ found to do this is to write "exerciser" classes
for each "main" class; these access every property, method, constructor,
etc. in the "main" class. If you [accidentally] change a method, this class
no longer compiles. It's not pretty and /far/ from error-free, but it's the
"best" I've come up with thus far.

Someone; *please* tell me this feature is coming back in VS'2005... :-)

HTH,
Phill W.
Nov 21 '05 #2
Thanks Phil. That's pretty much what I expected.

I'm looking at an application that was converted from Centura/SQL Windows to
VB.NET. Unfortunately, this was an "outsourcin g" effort, and the goal was to
do a straight port. No enhancements. No rewrites to take advantage of .NET
architecture. Because of this, we're in for some extra work. We've thought
about using interfaces, but now that the code is done, it will take some
reverse engineering. And you're right - to change the interface will take
some work.

The exerciser code would do it, but you've nailed that one too - not pretty,
and lots of work.

That old "binary compatibility" checkbox in VB6 did the trick. I'm with
you. I hope something like that comes back in VS 2005.
"Phill. W" wrote:
"DaveP" <Da***@discussi ons.microsoft.c om> wrote in message
news:06******** *************** ***********@mic rosoft.com...
In Visual Basic 6.0, there was a setting for DLL's that would prevent a
developer from breaking binary compatibility of a DLL by changing a
function name, parameters, etc. Warnings would appear at compile time.

Is there any such thing in .NET?


Guess what? There isn't!
(At least not that I've found, after a /lot/ of digging).

VB.Net will compile just whatever you tell it to, and doesn't give a
d*** that you might have just redefined every single method!

Interfaces go /some/ way to protecting against this; you publish (and
fix) the Interface; other Developers implement them. The down side
is that if you actually need to /change/ the Interface, you either have
to get into Assembly Versioning, or you have to rebuild absolutely
*everything* that implements the Interface against the new one.

The only other way /I've/ found to do this is to write "exerciser" classes
for each "main" class; these access every property, method, constructor,
etc. in the "main" class. If you [accidentally] change a method, this class
no longer compiles. It's not pretty and /far/ from error-free, but it's the
"best" I've come up with thus far.

Someone; *please* tell me this feature is coming back in VS'2005... :-)

HTH,
Phill W.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
12785
by: Marco | last post by:
I'm trying to learn VB. I get the following error when I add a VB project to the one I'm currently working on "Unable to set the version compatible component C:\...\Dir\bin\Project2.dll" where Project2.vbp in Dir is the project I'm trying to add to Project1.vbp. I thought I might have to register the dll, but the bin directory mentioned in the error message doesn't seem to exist. What should I do?
6
481
by: someone | last post by:
Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run with recompiling and relinking. I know that if I define an interface, and only expose the interface but not the class which implments the interface, I can add a data member to the class without breaking the binary compatibility. If the class...
3
3047
by: Michi Henning | last post by:
Hi, I'm interested in figuring out exactly what kind of change to an assembly is binary compatible. I've browsed the doc a fair bit, but I can't find a comprehensive list of what actually constitutes binary compatibility. Could someone point me at an authoritative list? One question in particular I am interested in. Consider an object such as this: class SomeClass
3
2120
by: David Laub | last post by:
How do you maintain VB6 like Binary Compatibility in .net?
68
5258
by: vim | last post by:
hello everybody Plz tell the differance between binary file and ascii file............... Thanks in advance vim
4
1895
by: zak | last post by:
we have a suite of products that have a number of shared assemblies. During development and support the shared assemblies code will change . I want to control the versioning, so if the code chnages are binary compatable ( i.e interfaces have not changed) then we can retain the same version number for the assembly and just change the hot fix number in the assembly. But how do I know that binary compatability has been maintained to...
1
1602
by: Simon Woods | last post by:
Hi I have a dll ('dll-X') which runs on top of (dependent upon) several other dlls. My build environment has a folder structure binaries compat-libs
17
2959
by: osama178 | last post by:
Hi, What does it mean for an object to be binary compatible? And why aren't STL objects binary compatible? Any insights, links, resources for further reading are greatly appreciated. Thanks.
0
9617
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.