I've got a simple VB.Net 4 WinForms application that does basic code generation. The code generation creates a DLL assembly perfectly fine, but each time the DLL is generated it needs to be registered programmatically with the GAC. The reason it must be registered is that it is a COM object that when deployed gets called via CreateObject from a VB6 application. Eww, I know.All of this works fine: the DLL generation, registering programmatically and using the generated DLL from the VB6 application.The problem is that my application that does the code generation can only generate the DLL once before the DLL is locked out by the process with no way to unlock it without stopping the EXE and starting it up again. This obviously prevents the user of the code generation tool from making a change and recompiling the DLL without restarting the application.[code]
I've tried throwing the assembly definition into a different AppDomain as I've seen in a number of articles on the web, but none of the implementations that I've come up with has worked. In fact, nearly all of them ended up with the generated assembly then being defined in BOTH of the AppDomains. I've also tried doing a ReflectionOnly assembly load but in order to the the register functions the assembly must be loaded in active mode not reflection mode.[code]
I have the need to retrieve the GUID that is listed in the "Assembly Info" page of the Project Properties.How can I get this data at run-time?(I've looked in the My.Application.Info, but it isn't in there that I can see)
I'm writing a log parser which is reading a log created by a game. This log can be written to many times a second. My problem is that my program is preventing the writing of the log at times. Is there anyway I can read the log file without locking it?
Sub readLog() If readyToRead Then If FileInUse(fileName) Then Return readyToRead = False
im workin on a task that will get the current computers Default Gatway, So i chose the easiest option, using the Registry, in most cases i find this with no problem at all, here's the code im using right now,
Public sHost As String = My.Computer.Registry.GetValue _ ("HKEY_LOCAL_MACHINESYSTEMControlSet001servicesTcpipParametersInterfaces THE GUID NEEDED HERE ", "DhcpServer", Nothing)
Which works fine, if i put My GUID in where i've stated in above code, I get the right value ect..., no what i was woundering is how would i get the program to preform this task on another Computer as their GUID will be diffrent, if their away i can do this with simplicity?
We have a vb.net desktop application that uses a number of graphical images. All is well when the Windows Display is set to the default small font; however, when the display is set to the medium (125%) font, the graphical images don't display properly. We can accommodate the changes to windows sizes and text boxes, etc using autoscale and autosize; however, this doesn't help with images. Is there any way to overcome this issue?
In an ideal world, we wouldn't need to educate our users about the "intricacies" of ZIP files One of my apps is a stand-alone-ish app that has no dependencies that need to be installed. Well, except for the Framework of course.So, in order to make the download smaller, I've zipped up the package. One of the functions of the app is to download some files into a subdirectory the application is located within. Well, some users don't unzip the package and as we all know, you can't just download some files into a ZIP file. I spent a good 20 minutes looking through my code and adjusting things to figure out why it wasn't working for one user, when I realized there were no issues in my code and that he probably wasn't unzipping the package.So, does anyone know of a method to determine if the directory my app is in, can be written to?I know I can just try writing a small file or something and catch the exception, but that seems... sloppy.
We loading and executing an assembly dynamically from code. While reading a dynamically loaded assembly how can we find an interface within the assembly which is marked (decorated) by another class like below
<ExternalDataExchange()> _ Public Interface IwfService Event firstEvent As EventHandler(Of ExternalDataEventArgs) End Interface
Here how can we find that we have interface "IwfService" which is marked with "ExternalDataExchange()" class.
I can't send email via ASP.NET and sent an email to my web hosts for some help and was told to modify my security settings and was sent a link:[URL]..I've read what it said there and tried setting <trust level="Full" originUrl="" /> in web.config, but then I get the error:
This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.
I've not set any other web.config file.So I asked the web hosts again, and asked if it was a server setting which I cannot change, but the response I got was just:
You'll need to specify a more specific path. Which is lovely, but I've no idea what that means! Having done a bit more digging I am wondering if I have to set up a separate trust file, is this correct? Could someone point me in the direction of the correct way to set up my Trust level (I realise "full" is probably incorrect as well?) as I really don't understand what I am supposed to do!
I am having a devil of a time getting a couple of VB 2003 web apps that have been converted to VB 2005 to run on the remote server I use ... I am able to debug/run them on my local development machine. The problem seems to be centered around the web.config files for these apps. They each contain <compilation> elements with embedded <compilers> and <compiler ...> child elements. The <compiler ...> element has a number of attributes including compilerOptions. When I run each app from the server I get the following message:
I am new to ssl. I am trying to Post some data to OWA using httpwebrequest class using following code. Dim post As Stream post = web1.GetRequestStream post.Write(data, 0, data.Length) post.Close() But when I try to get request stream to submit data using above code.(JUST PART OF CODE).i get following error. The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
i am trying to Post some data to OWA using httpwebrequest class.
Dim post As Stream post = web1.GetRequestStream post.Write(data, 0, data.Length) post.Close()
but when i try to get request stream to submit data using above code.(JUST PART OF CODE).i get following error.The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
I am creating what could amount to quite a few temp files on a terminal server using the System.IO.Path.GetTempPath. My question is this. Can I trust Windows to clear that directory on a regular basis or do I need to clear it in code?
When running setup to install published program, the following message occurs: System Update Required: Unable to install or run the applicaiton. The application requires that asssembly CrystalDecisions.CrystalReports.Engine Version 10.2.3600.0 be install in the Global Assembly Cache (GAC) first. This version is listed in the references of the program and in my mind, be included in build. How do I get by this error?
When running setup to install published program, the following message occurs: System Update Required: Unable to install or run the applicaiton. The application requires that asssembly CrystalDecisions.CrystalReports.Engine Version 10.2.3600.0 be install in the Global Assembly Cache (GAC) first. This version is listed in the references of the program and in my mind, be included in build. How do I get by this error?
I have recently upgraded an VB6 project to vs2008. I was almost finished when the following error occured. Unable to emit assembly: Referenced assembly AxInterop.MSFlexGridLib does not have a strong name Prior to this error appering, I tested my app several times and it was fine. Only after publishing it did the error appear. I have tried all solutions I could find, but nothing helps. I have read [URL]
sAssemblyName is the one I loaded using LoadFrom() actually. After it said it cannot find the assembly, I used AssemblyResolve event which solved my problem :Subscribing AssemblyResolve event :
Private Shared Function MyResolveEventHandler(ByVal sender As Object, _ ByVal args As ResolveEventArgs) As Assembly Return Assembly.LoadFrom("C:\PSIOBJ\" + args.Name + ".dll") End Function
And I thought maybe the error occurs because it cannot find a dependent assembly defined in assembly manifest file I loaded using LoadFrom() already but when I checked the args.Name, I saw it was trying to load same assembly and after that it worked without any problem. So basically a type in the loaded assembly cannot be found before the event adding change.
My old code was using AppDomain.CurrentDomain.Load() and Assembly.Load() methods and they were working fine without the AssemblyResolve event. I was able to reach types in dynamically loaded Assembly from every where within the same AppDomain.
LoadFrom() can find dependencies automatically within the same requested assembly path and that couldn't be problem as everything this dll needs was there. So at first it looked like a AppDomain problem to me as it looks like it seems it can reach assemblies from Load context instead of LoadFrom context and I am now using LoadFrom context.But now it seems I should pass oAssembly instance evertwhere to use any type from the loaded assembly?Doesn't it load the assembly where I can reach it everywhere (same AppDomain) using simple Type.GetType(...) method?
have created a new AppDomain with a unique name. But i do not want to store that name during the whole application runtime.So i ask you guys if it is possible to get that created AppDomain by name back.
Sub Main() AppDomain.CreateDomain("TestDomain") End Sub
so How do i get the AppDomain with the name "TestDomain" back so i can unload it later without storing that AppDomain globally?
I'm wanting to include a system tray icon in my WPF project, and found this resource:[URL]..which looks like it will work beautifully, but it's written for C# and I'm using VB.net for this project. I downloaded his project and built the notifyicon as a DLL, then added as a reference to my project.
It throws up an error: Unable to emit assembly: Referenced assembly 'Hardcodet.Wpf.TaskbarNotification' does not have a strong name So I'm trying to figure out the best way to proceed. Do I need to strong name it, or is there a better way to do this?
I've got an exception when I deployed my application: "the located assembly's manifest does not match the assembly reference" What I remember is changing the project name from the previous source code, does it affect that much?
Can you have more than one AppDomain in a process Or more than one process in a AppDomain? What about threads? I was always told there were many threads in one process and one processor has many processes. How does App Domains fit into this picture?To me, it seems like its the same concept with a different name??
the forum,this is my first message, and I hope that my English is understandable (I'm Italian)....I've developed a WIndows Service using VB.net 2.0; this service executes a routine every 4 hours... I would like load a dll (without entry point) at run time and when the operation is terminated, I would like unload that. I think that I've to create a new AppDomain and to load my DLL into this, but I don't know the good way to do it.
Which one of these two do you suggest for writing simple windows form applications?Visual C++ is too complicated for my small to medium applications and the proccess of creating seems to be longer when compared with C# or VB.NET.
First, I changed my ILS function to be simply: Public Overrides Function InitializeLifetimeService() As Object Return Nothing End Function
Then I included this in my Program as well as A. As Timiz0r pointed out, Form inherits MarshalByRefObject, so I didn't have to include a Inherits statement on my main class (which already inherited Form). This was the big thing, because I didn't include it originally. Next, I changed my AppDomain setup to be:
Dim _ADomain As AppDomain = AppDomain.CreateDomain(Name) Dim item As New A item = CType(_ADomain.CreateInstanceAndUnwrap(GetType(A).Assembly.FullName, GetType(A).FullName), A)
With these changes I can now use separate instances of the DLL COM object as desired.
Original Question I am writing an application that creates a list of objects, each referring to a DLL, and each object placed in its own AppDomain to keep the instances of the DLL from interfering with each other. Taken another way:Program maintains a List(Of A)A is created as an instance of AppDomain using CreateInstanceAndUnwrap Each A refers to mirror.dll, which is including in the application's references
I keep getting a "System.Runtime.Serialization.SerializationException" in my application while loading a not-defined assembly (AKA: Plug-in loading.)Even if I turn Serialization on for that plug-in, then it will fail once again. I've been looking around and couldn't find a good tutorial about it..
So all together: How to load an assembly using AppDomain?