Referencing/managing/code For Different Versions Of The Same External Assemblies?

Aug 16, 2011

In a VB.NET (3.5) Windows Forms application that, among other things, creates Microsoft SQL Server Integration Services (SSIS) Packages, we want to be able to support the creation of packages both for SQL Server 2005 and 2008. To create packages compatible with SQL Server 2005, functionality from external Microsoft assemblies with the specific version of 9.0.242.0 are needed, and to create packages compatible with SQL Server 2008 the same assemblies need to be referenced, but with another version number, 10.0.0.0. There does not, unfortunately, seem to be backwards compatibility in that SQL-2005 packages could be created using functionality in the newer 10.0.0.0-assemblies.

Today, we have a very inefficient way of handling this. For each new release of the app, we have to: Build two different versions of the app, one "2005-compatible .exe" and one "2008-compatible .exe", by: Manually add/remove the specific 2005/2008-references at project level (properties).Comment/uncomment respective code that is not common between the two versions of the same assemblies.At installation time of the application, figure out if the machine runs SQL Server 2005 or 2008 and then install the corresponding build/version of the app.We do not ship or install any assemblies with our application but instead rely/pre-requisite on that the machine on which we install our software has either the 2005 or 2008 assemblies installed in its GAC (depending on whether SQL Server 2005 or 2008 is installed there).

I have learned that with a few tricks it is possible to reference and use identically named assemblies with different version-numbers in the very same project. But even then if we manage to do this, since the client machine always will only have only one set of the assemblies installed in its GAC (9.0.242.0 or 10.0.0.0 versions depending on which SQL Server version it has installed), and we need to reference both sets in the project to have "full support" for both 2005 and 2008, how can we avoid potential "missing dll-messages" when the client runs the app? We do not feel very excited about having to ship/install 2005-assemblies on a 2008-server and vice-versa, that would never be used by the application, even if this would constitute a solution to the above problem.

View 9 Replies


ADVERTISEMENT

Database - Referencing A Control Programmatically With External Source

Jan 30, 2010

I have a MS Access database set up, with a Period field that has either values 1, 2, 3, 4 or 5. I retrieve these values using a database connection and I would like to reference a particular control based on what period was grabbed from the database.

Here's example code, pseudo of course.

TextBox(dr(3)).Text = dr(0)

dr(3) contains the period, and dr(0) contains the content I would like to put into the text box. I have these text boxes on my form: TextBox1, TextBox2, TextBox3, TextBox4 and TextBox5.

So if dr(3) contained 2 then I would want to reference TextBox2.

View 1 Replies

Managing An FTP Server With VB Code?

Jun 21, 2010

I'm trying to manage an FTP server with code that requires authentication.So I need to log in, get a list of directories and files within a sub-directory, Create directory, Delete directory and Delete File. (I know how to download and upload) I can't find any documentation on how to do this...though I would think it a fairly simple question to answer I seek not answers, but understanding, that I may not solve, but learn. What good is a fish without the skill to catch it?

View 1 Replies

Managing Form's Code In .net?

Sep 24, 2011

Whats the best way to organize code responsible for Form's content.In my case, there is a DataGridView and list, next to it, with a few options available (projects, managers, employees, etc...). Choosing any list's element fills DataGrid with proper data from database.Now, GridFill functions + handling of all add/delete/edit buttons of each list element gives quite a code in the Form's source, which bothers me a bit. How to split it then to avoid problems in the future? While googling, I've seen some advices to use partial classes, modules or just classes. Moving all functions relating the Projects, Managers, ... , to own separate class sounds like a nice idea but then comes the question how to pass all necessary data to the class functions.

View 1 Replies

Getting Runtime Error 3447 - Jet VBA File (VBAJET.dll For 16-bit Versions Or VBAJET32 For 32-bit Versions) Failed To Initialize When Called

Aug 19, 2010

To the board: Lately I've been getting Runtime error 3447 ("The Jet VBA file (VBAJET.dll for 16-bit versions, or VBAJET32 for 32-bit versions) failed to initialize when called. Try reinstalling the application that returned the error") when attempting to open a certain program (not one that I designed, just downloaded and installed). I installed this program in January 2009, but this error began happening only this past July. someone else to information about the files vbajet32.dll and expsrv.dll. One site said that the problem was probably caused by the file expsrv.dll being absent, but I checked my System32 folder, and it's there. As far as I can tell, it has always been there (the computer was made in 2008, and as I said the program had always worked before). Vbajet32.dll is also there. I tried uninstalling and reinstalling the program, but error 3447 still occurs. I also tried uninstalling the program and installing an older version, but 3447 is still there.

I tried replacing expsrv.dll, thinking it might have been corrupt, but that didn't help, and I cannot register that dll anyway. I can't figure this thing out. Both of the files are there, and I didn't change any settings or anything anywhere between last January and this July. By the way, I am on Vista.

View 1 Replies

Code For 2008 And 2010 Versions Of .Net?

Sep 3, 2009

<edit> On 27th January, 2011.If you are using VB.Net 2005 or earlier then please see my 14th post in this thread.</edit>I saw a post earlier on which reminded me about Extension Methods.This led me to create the following code which acts on the base class

[Code]...

View 1 Replies

VB Express 2008 - Alot Of Errors Appear When Using Code From Other VB Versions

May 15, 2009

I am working with VB Express 2008 and i am having a lot of errors appear when using code from other VB Versions. Is their a computability problem

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button2.Click
'CLICK TO OPEN DVD ROM DRAW Declare mciSendStringA Lib "winmm.dll" (ByVal lpstrCommand As String, _

[CODE]...

Use code tags when posting your code. Code tags are used like so =>

View 3 Replies

VS 2010 Referencing Web Service With Code?

Mar 22, 2011

I did a search on the internet but came up with very limited results. I'm using asp/vb and need to create a n application that does the following steps:

1. User defines web service URLs to WSDL pages .. populated in combo drop down (already coded)
2. User selects web service - Clicks Connect
3. User is prompted for any input fields the web service requests.
4. Output (in XML) is displayed after input fields are populated.

I know how to reference web services in the development environment, and use them... but have no idea how to dynamically create them and show the input fields requested.

View 1 Replies

.net - Referencing Code-behind Properties On .aspx Page?

May 15, 2011

On a .aspx page, what is the best way to link a server control's property to a property of the page class (its code-behind)? The only way that I have read about is to use databinding:

<asp:TextBox ID="txt" runat="server" Text='<%# Me.SomePropOfMine %>' />

and then call Me.txt.DataBind() or Me.Databind() from the codebehind. Is there any way of establishing this relationship on the .aspx page alone, or simplifying the process if you have many controls to bind (without binding the entire page)?

View 3 Replies

Asp.net - Referencing Class Library In Inline Vb Code

Feb 15, 2012

I'm working on a legacy vb.net application that does most of its work using inline code ( Within that script I need to access functions from a third party .net dll. The dll(s) themself are stored in the GAC. Before I started the page looked something like the following

[Code]...

View 2 Replies

Include Code Or Files From Other Projects WITHOUT Referencing Them

Nov 16, 2011

Is there a way that I can include code or other files from other projects WITHOUT referencing them? I am trying to combine our projects into 1 EXE without DLLs. I do not want to use a self extracting EXE either. Let me know if there is a way to do it similar to the C++ #Include.

View 5 Replies

Referencing XAML Custom Control Names And Properties Within Code Behind?

May 13, 2009

I've created a Custom Control, and I will be placing a large number of instances of that Custom Control on my xaml page. In working with that Custom Control in the VB Code Behind, how do I do the following?

How do I reference the name of the Custom Control (in my VB code) which was clicked with the MouseLeftButtonDown event? For example, if I have 10 instances of my Custom Control in xaml, each with a different x:name (say 1-10), when a particular instance is clicked, how can I see which one was clicked? I've tried a number of things including e.OriginalSource.Name (which returns the component within the control which was clicked and not the name of the instance of the control). My Custom Control consists of numerous parts and pieces (Rectangles, Lines, Text, etc). Each of these items is a part of my layer. In VB code, once I can reference a particular Control, how can I hide or change certain parts of that control (such as hiding a Line, and changing the text). Also, I need to modify more than just the control which was clicked, so I need to be able to access properties of all of the controls, not just what was clicked. For example, if I click Control instance Test1, I also need to modify Test2, Test3, and Test5 in some way.

Here is some test code I through together as part of a Silverlight project using MS Blend 2. My control is much larger, and I need 200 - 250 instances/copies of that custom control, so I really need to know which control instance/copy was clicked.

My UserControl:

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

[Code].....

View 1 Replies

VB Express Code To Run External Application?

Nov 25, 2009

How can I write codes to run an external application like PowerDVD9 in Background.

View 4 Replies

Executing An External Program In Powerpoint And Waiting For It To Finish Before Moving On To More Code?

Nov 23, 2011

I would like to execute an external program within powerpoint after the presentation has loaded so i can see if its working. In short my overall objective is to execute the external program which will open up the command prompt and use the sendkeys method to sendkeys to command prompt which help it to run a script at the correct time (which is after presentation is loaded).

View 9 Replies

Why The Excel File Not Opening Using This Code - Error - ExcelConnection.Open()External Table Is Not In The Expected Format

Apr 17, 2012

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" + fileName + "'; Extended Properties=Excel 5.0"
Dim ExcelConnection As System.Data.OleDb.OleDbConnection
ExcelConnection = New System.Data.OleDb.OleDbConnection(ConnectionString)



Error occurs on line ExcelConnection.Open()External table is not in the expected format.

View 2 Replies

Reference A Particular Code Routine In .net External To The Current Loop/routine?

Apr 17, 2011

is there any way to reference a particular code routine in VB.net external to the current loop/routine?Example:

If Var01 < 5
[Routine A]
Else
[Routine B]
End If

where Routine A and Routine B are code sequences at the end of the entire program -- such as outside of the current sub or class? The idea would be to reference an otherwise repetitive code.

View 4 Replies

How To Assemble Assemblies

Jun 13, 2011

In my .aspx file I have:

<%@ assembly src="extensions.vb" %>
<%@ assembly src="debug.vb" %>

[code].....

View 2 Replies

.net - Stop Asp.net Looking For Assemblies In GAC?

Sep 20, 2011

I have started working on a legacy project (ASP.NET 1.1) which was done in an old machine (which I dont have access to). And I am unaware of the development environment settings used for building this project.

Nonetheless, I am able to build the project and deploy it all well from my machine (I created the full development enviroment locally). In my machine everything works great.But some screens where one of the assembly dlls (third party dlls) are used do crash on any machine other than mine! They probably do net get the proper assembly (with matching version or something), even though when I have put all the assemblies in bin (and used the same files while adding references to the project). .NET runtime probably tries to find them in the GAC of the other computers? Or probably in my system itself it loads from GAC and not from the bin? How could I know all this? The question is it runs perfectly fine on my machine, where the assemblies are at both places - in bin and in GAC.

I am lost what I should do to so that no matter which machine I deploy the project, it should always look in bin only! Also, I dont want to change the code in any way because its a legacy code and has been working all right since ages! Just some settings e.g. maching.config or soemthing?

View 1 Replies

C# - Get Assemblies Without Instantiating Them?

Mar 30, 2012

I am trying to get all assemblies in CurrentDomain using AppDomain.CurrentDomain.GetAssemblies() to write their FullName into a DropDownList, however if I don't instantiate them, they are not seen in returned array from GetAssemblies() in CurrentDomain.They are all added as Reference and in Reference folder of the solution. Only time I can get them from the GetAssemblies() is when I first instantiate them.How to overcome this problem with an easy and more generic way instead of instantiate them everytime when I add new Assembly, etc.Due to company policy, I have to obfuscate some parts of the images: All the assembilies are referenced in Reference folder:

View 3 Replies

Zip A Folder Without Any External Dll Nor Any External References?

Feb 3, 2012

I wanted to know if it is possible to Zip a folder without any external dll nor any external references - just with native features.I've been able to Zip files with System.IO.Packaging, but it does not include folders and I cannot tell it to Zip the parent folder.I know there are external dll and so, but I'd like to know if it's possible to make it from a native way.

View 1 Replies

Assemblies Not Being Loaded Properly?

Sep 19, 2009

I have a windows forms Application using DCOM to connect to another server in order to retrieve data from a database. The program works perfectly fine on my develeopment box both inside of and outside of the idea.However it throws an exception on my test box: System.Exception.... TYPE_E_CANTLOADLIBRARY. The error happens when accessing a property of on the the public DCOM classes. The property holds an instance of one of the private classes for the DCOM. I've compared the registries and all the relevant entries seem to be the same. When I compared the dumps I noticed that System.Config and System.XML werent loaded on the test machine, even though they are installed and appear to be in the GAC.

[Code]...

View 6 Replies

C# - Compare Compiled .NET Assemblies?

Mar 16, 2009

compare to compile .NET assemblies?

For example I have HelloWorld.dll (1.0.0.0) and HelloWorld.dll (2.0.0.0), and I want to compare differences how can I do this?

I know I can use .NET Reflector and use the Assembly Diff plugin. Are there any other good tools out there to do this?

View 5 Replies

C# - Dynamically Loading .NET Assemblies?

May 25, 2009

I am writing a program and I want the program to support plugins. I created an interface that the program must implement. I am using the following code from my main program to call the plugin:

Dim asm As Assembly = Assembly.LoadFrom(ff.FullName)
' Get the type
Dim myType As System.Type = asm.GetType(asm.GetName.Name + "." + asm.GetName.Name)
' If the type is null then we try again without the root namespace name

[code]....

I set this property from my main program and everything works. Except, after a while, m_PanelObject gets set to Nothing for some odd reason. I'm not setting it to Nothing anywhere in my program and there is no place in the plugin code that sets it to Nothing.

View 1 Replies

C# - Dynamically Loading Assemblies In .NET?

May 24, 2010

We've built a small component which takes an Id, looks up an entry in the database for an assembly/namespace/class, and dynamically loads an instance of the class that we're after. It has been working fine up until now, but when running this code in VS 2010, it's failing.

Private Function AssemblyLoaded(ByVal assemblyFile As String) As Assembly
Dim assemblies() As Assembly = AppDomain.CurrentDomain.GetAssemblies
For Each asmb As Assembly In assemblies

[Code]....

But it feels dirty. Is there a better way of checking if an assembly is already loaded, and handing that back to the caller? Are the issues above specific to .NET 4.0 or Visual Studio 2010? I haven't tried this outside the IDE as it requires fairly significant configuration.

View 2 Replies

Dynamic Assemblies Loading?

Dec 22, 2009

Do you know any other alternative for dynamic assemblies loading? Other than the method below:

[Code]...

View 4 Replies

Install Assemblies In The Gac Without The Gacutil?

Jul 18, 2010

I'm deploying a vb 2005 application that references crystal report XI release 2 components. How do i install these components to the gac? The client machine does not have gacutil and i don't know how to use msi to do the job. I have researched the web for answers without success.

View 6 Replies

.net - Managing .exe Files?

Sep 7, 2009

In VB.net, how can you programmatically launch a .exe file? Is there a way to check if the file is there?

I know there is some way to check using System.IO, but I have no idea. However, I have not even the slightest clue as to how to launch that .exe if it is there,

View 4 Replies

Managing Combo Box In Different Way?

Oct 12, 2011

In my programme, Student have to select 1 major subject out of 5 subjects and 1 subject for major2 subject our of 4 subjects. And student will have to select 1st major subject according to the preference and will have to select each 4 subjects for major 2 subject against each major 1 subject.as an example if student slect csc for major1 he can select 1st preferce stat , 2nd pref.. maths, 3rd pre.. managment. 4 th pre... eltn for 2nd mejor subject.so, if anyone select one subject for major 1 , I want to remove it from major 2 and display the rest of subject.

cmbBox2.Items.Add("CMIS")
cmbBox2.Items.Add("ELTN")
cmbBox2.Items.Add("IMGT")

[code]......

View 3 Replies

Managing To Get Ip Of A Server?

Jul 5, 2009

I would like to know how I can get a server ip.I have a textbox (textbox1), a label where the ip will be displayed, and a button that will get that information.this code is not related to this but it performs a simmilar action but instead in displays the ping of a given server:

Dim reply As System.Net.NetworkInformation.PingReply
Dim p As New System.Net.NetworkInformation.Ping
Try

[code]....

i want to use the same textbox to get ping and ip of a given website triggered by the same button.

View 5 Replies

Sql - Ado.net Managing Connections

Jun 6, 2010

I'm populating a listview with a list of databases on a selected SQL instance, then retrieving a value from each database (It's internal product version, column doesn't always exist) I'm calling the below function to populate the second column of the listview:

[Code]...

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved