How To Assemble Assemblies
Jun 13, 2011In my .aspx file I have:
<%@ assembly src="extensions.vb" %>
<%@ assembly src="debug.vb" %>
[code].....
In my .aspx file I have:
<%@ assembly src="extensions.vb" %>
<%@ assembly src="debug.vb" %>
[code].....
error: when assign the strong name in assemble
Use command-line option '/keyfile' or appropriate project settings instead of System.Reflection.AssemblyKeyFileAttribute'.
I am using vb2008,I imported Custom Tool from my other project,It is on my project,But it is showing Below Warning, Not Error..!Warning Could not find type 'VBProject2.AxMSHFlexGrid Array'.Please make sure that the assembly that contains this type is referenced.If this type is a part of your development project, make sure that the project has been successfully built.
View 1 RepliesWhat Visual Basic code can be used to assemble and send a raw packet, and receive response packets? I looked on MSDN and I couldn't find any documentation for anything used to send a packet.
View 2 Repliestrying to write some VBA code to assemble different SQL code according to user settings on an Access form. The code below is not the actual code but shows the problem I have been having very simply.
Dim SQLsearch1 As String
Dim SQLsearch2 As String
Dim A As Integer
[code].....
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:
View 3 RepliesI 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]...
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?
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.
Do you know any other alternative for dynamic assemblies loading? Other than the method below:
[Code]...
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 RepliesIf 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))
[code].....
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.
Is that a fair analysis?
We have a large application that implements "scripting" (i.e, dynamically compiled user code that can include user-defined .dll references).
View 5 RepliesI 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.
View 4 RepliesI have developed an application that creates Excel and Word documents, hence, Interop.Word.dll and Interop.Excell.dl asre being included into the installation package.May I redistribute these dll's with my application package? And how does the Developers Licenses work?I live in SA and have heard that the redistribution rights may be different.
View 4 RepliesI created a .net assembly, which works perfectly if I create before runtime. But i'd like to know if it's possible to reference at runtime. The reason is because i'm creating an application which will be used in several servers, and it will be reference that same .net assembly, but the .dll file will be in different location per server. I know that when I reference before runtime, the .net assembly it will be pointing to is from the original (or at least that's what I think).
View 2 RepliesHow to set an application to check their reference assemblies first locally(root folder)then if fails globally(GAC)
View 4 RepliesI'm trying to reduce as much as I can my VB.Net assembly side, and I just figured out that all variable names were kept unchanged in the actual assembly. Since I tend to use pretty long var names, it adds up and, by running dotfuscator on my assembly, I could shrink it by as much as 10%.
[Code]...
I'm wondering if it's possible to check in the application start if the system has the correct assemblies installed to my application to work?Let me explain, i have a application that uses several reports, and to solve the problem of the first time open report, I run in another thread a dummy report. This works fine if the user has the crystal reports installed but if it doesn't the app stops working.
View 3 RepliesAs an OSS library author, I've always tried to make my stuff CLS compliant. But MS doesn't make this easy. They often put you in catch-22 situations, such as the following:You cannot have a protected variable differing only in case from the public property.You cannot have protected or public variables starting in an underscore or 'm_'. If you want to make a class really extensible, you often need to have protected variables matching public properties. Your least ugly exit is to add a suffix to the variable, like "Var" or "Value". That's nasty and unacceptable to me. I like clean code.I know of no .NET languages that don't support variables starting in an underscore, and I've used them in many places where the variable needs to be visible to subclasses.
I'm tired of the warnings, and I'm planning on turning off CLS compliance at the assembly level on my 30+ C# libraries.Are there any actual problems with turning off CLS compliance on libraries? Any real problems with doing this? Microsoft has issued unheedable guidance on software for decades, with less that 5% of it being worth the bytes it was encoded in. I can't find any evidence that this best practice has any real effect on anything. But, to be careful, I'm checking. And no, this is not a duplicate of the inverse of this question: Any reason not to mark a DLL as CLSCompliant?I'm looking for actual results and effects here, not the advice of a MS intern. For example, if IronPython, IronRuby, or F# are unable to read or write a variable starting with an underscore, that's an effect, although it would only cause a problem for users subclassing certain objects. If a language or tool is completely unable to use an assembly unless it is marked CLS compliant, now that's a big deal.
I'm working a business layer (separate assembly) that will contain various business entities used in multiple client applications. One of the client applications is a WCF app that will need to serialize these entities. In order to properly serialize the entities, metadata for data contracts or for XML serialization must be added, but the serialization requirements may vary across applications.
Clearly I need the metadata separated from the class definition. So how do I add metadata to my entities for each separate application?
I simply want to speed up web services so the first call does not take 8-10 seconds, while the subsequent calls take a half a second. I have learned that the Generate Serialization Assemblies option in Visual Studio does not actually use sgen to generate the dll. So I used sgen with the dll my web service uses to create the MyWebService.XmlSerializers.dll file, and it did create it. So then I placed onto the server. I still have the same speed problem. Do I have to place something in the config file to tell it to use this? Do I have to learn all sorts of parameters with sgen to make sure I set it up properly?
View 3 RepliesI am having an issue with my program that I hope you can help with. I have integrated my program to work with Outlook and I have installed the 2003 Primary Interop Assemblies on the client computer and it works fine (i.e. opens Outlook Email and attaches a file from my program). Well, we have many computers here that run Office 2007, so I installed the 2007 PIA on their computer and it doesnt work. It doesnt tell you anything in the error when the update download fails, just "You need to contact your system administrator". Is there anything else I need to do to get it to work with computers running Office 2007 - any references I need to add, or properties needing changed?
I know the isnt any issue with the server, connectivity, or anything like that because it works just fine on computers without Office 2007.
I would like to protect my assemblies with Dotfuscator Community Edition I have a setup project that builds an MSI installer. I was wondering if theres any way to include this into my project so that when I build my solution Dotfuscator Community Edition automatically protects the assemblies
View 4 RepliesDoes anyone use NGen to generate native images of their assemblies? I have always been quite puzzled by NGen because all MS articles that describe it basically make it sound like it has quite a few advantages compared to the disadvantages. Basically it looks like it will improve the speed of your application in most cases but if that is the case then why doesnt everyone use it all the time?or maybe they do and its just me that has not really used it much.The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.
View 15 Replies