VS 2005 - Cross Compiling DLLs (Assemblies Or References)
Oct 19, 2010
I am reinitiating again with these great topis on .Net. Mainly VB.Net. A friend of mine shared source projects, but can not compile. It is composed of a project that creates an .exe file and more than one project that create a DLL that are been used during the program execution. The thing is that project 1 (that creates DLL1) has a reference to DLL2. Normal I would say. But what surprised me is that project 2 (that creates DLL2) has a reference to DLL1.
More complex? Let's say that the program has 6 different projects (that creates 6 DLLs) and each of those has a reference to the others and viceversa? DLL1 has a reference to DLL2, DLL3, DLL4, DLL5 & DLL6. DLL2 has a reference to DLL1, DLL3, DLL4, DLL5 & DLL6. DLL3 has a reference to DLL1,..... and on and on. How to compile successfully these DLLs?
I am using CompilerParameters to dynamically compile code... The problem is when I use: cp.ReferencedAssemblies.Add(CompilerPath & "est.exe") to add a reference to test exe ... (where CompilerPath is the full path name) Compiler Path is not the Compiler Application Path
I get an error when compiling stating that: vb "Could not load file or assembly 'test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." If I put it in the test.dll in the "compiler apps" path and then call ReferencedAssemblies.Add with the full path it works.
I have created an application and a setup application for it.The application references Microsoft.mshtml.dll and another custom dll.The problem is that despite the fact that i added to the setup project the output of the application, these two dlls were not added in the setup project's "detected dependencies". Do i have to add them manually ? Do you know if Microsoft.mshtml.dll (C:Program FilesMicrosoft.NETPrimary Interop AssembliesMicrosoft.mshtml.dll)will work both on Windows XP and Windows Vista no matter what version of Internet Explorer is installed ?
I am trying to understand how to interact with external DLLs written in C++ for use in my VB.NET application. I have some DLLs that a client wrote that do some math functions. Everything was working on a 32-bit machine. Because we were taxing the 32-bit machine we moved to 64-bit. Now we can't get the same functions to work. The DLLs were re-compiled as 64-bit DLLs and they still don't work. So my client wrote some dummy DLLs to see if we could figure out the problem. Here are the "signatures" of the DLL calls that I am making:[code]....Ultimately I would like to get to calling initialize_quiet and I am guessing at the format of the marshalling, const size etc.
I have added reference to few dlls in my VB.net Project. When I check into Visual source safe and get latest version from another machine, VS.net 2008 throws errors.I have to add the references again in that new machine. Is there anyway where I can keep the references in spite of files checked in to VSS?I need to send copy all the files to production server and we don't have VS.net on the production box to add reference and build the application.
I have Crystal Reports 2008 installed on my win7 laptop but when i go to insert references from my application settings the CrystalDecisions references are missing and im not able to find them. Note: they do exist in my "c:windowsassembly" folder.
In one of my forms witch I imported from VB2008 there are all properties saved in the *.resx file. One Property, of the Type System.Windows.Forms.Keys, can contain the Value 'Ctrl+F1' witch compiles fine in VB2008, but not in VB2010. To reproduce, simply add the following to any resx file:
I have this VB ASP.NET Web Service Application project running VS 2005. I'm trying to add references. To do so I click on the "Properties" icon in the Solution Explorer window which presents me with a window to add/update/remove references. I click "Add", I select the reference I want and then "OK". Lo en behold, NOTHING! It simply won't add references (I tried adding several different ones). Specifically I'm trying to add the System.Configuration assembly.
My application need to communicate with my self made device through serial port. I have to change the selected index of Tabs when I press a button on my device. I have Form1, Form2, Module1 Form1 Contains the Serial Port Control. Form2 contains the Tab which needs to be changed. When I press a button on device them, the button pressed is stored in an integer form in a global variable.The Interrupt for the Serial Port directs the control to the module1 where I decide using Select Case that what index of which TabControl I have to select.Depending on that, I change the Index of the required Tab.
PROBLEM:cross thread exception is fired as soon as the control reaches the statement where I Modify the SelectIndex property from the select case at Module1.While, on my other PC, the SelectIndex property is changed, but the next tab is not shown.
BUT, if I put all this code in a button control, and try to activate from there, then it works perfectly. However, I have to navigate through the tab controls using my self made device.I searched a lot on net and came across a solution which describes that we have to use delegate function and invokeRequired methods to ensure that the procedures run on the same thread.I am not able to decide that where exactly shoud the code for delegates and all be written, in form1, or form2, or module1.Also, in the hit and try that I did, I always got the value of InvoleRequired as False.
Here is the part of Code that I wrote for Delegates
Code:
'Form 1 is BLINDHELPER_SIGNIN 'form 2 is BLINDHELPER_USER
' I have defined these at Module1
Public Delegate Sub DeleToManageTabs(ByVal tb As TabControl) Public Sub manage_Tabs(ByVal tab As TabControl) MsgBox(tab.Name)
[code]....
After using this code also, there is no change in working of my application.
I am trying to use a cross cursor and make it the width and height of the form without any luck. I read in a thread i may have to use a custom cursor, is this true? I have tried to re size the Cursors.Cross
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?
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:
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.
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.
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.
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.
If I try to call my extension method which is defined like this:
Module LinqExtensions <System.Runtime.CompilerServices.Extension()> _ Public Function ToSortableBindingList(Of TSource)(ByVal source As IEnumerable(Of TSource))
I thought I would practice using reflection by building an Object Browser similar to what's in VS2010.
The reflection part is easy enough, but I'm can't find any means of determining where all of the assemblies are installed. On my machine (Win 7) the GAC would seem to be located at C:Windowsassembly.
However, 4.0 assemblies look to be located at C:WindowsMicrosoft.NETassembly in either GAC_32 or GAC_MSIL.
VS Object Browser obviously knows where to look, you can even filter on "All Components" or select a framework version.
But when I look at the Object Browser in VS, I find that it lists assemblies from several different locations: For example...
CODE:
How does VS know to list these assemblies? Is there some registry key I'm missing that defines all of these locations?
Ok, I've read every question on here about strong named assemblies and just want to clarify something. First though, from what I've read, GAC aside, strong named assemblies prevent a malicious 3rd party changing and impersonating your code. It'd be great to have some links to some real world examples of this kind of spoofing that happened pre strong named assemblies. If security or the GAC are not a concern, It seems that it's still advisable to strong name assemblies because:
(A) Clients who have strong named assemblies can only reference your assemblies if they are signed.
(B) Clients who do not have strong named assemblies can reference your assembly whether it's signed or not.
I have two executables that access a DLL containing Data Access Layer objects Each exe can have a different config containing info on server and database name, connection string etc.How do I pass the config info to the DAL objects?
Obviously I can pass the config strings to the DAL objects every time I instanciate one, but that seems messy and repetitive as every class in the DAL will require Properties for the Config strings..if there is a way for the instanciated DAL objects to read some properties from the calling object without me having to pass them explicitly?
I've recently reorganized some files on my current project and renamed the namespaces. Now whenever I try to reference a method from an object that I've instantiated I get told by the debugger that I need to recompile any assemblies that reference that method.