We have a VB project that loads a reference to a .Net dll (which we also make). Both projects are being simultaneously developed.
When we add new classes to the referenced dll, the main project normally fails to notice the changes.
That is, if we added a new class Bar to the Foo dll, we should be able to type "Foo." and have Bar listed in the intellisense dropdown. It's never there.
Removing the reference and then adding it back in again sometimes fixes the problem. Sometimes we have been able to just manually type Bar in and then rebuild without errors.
It seems to me that there should be some way to tell Visual Studio to reload the referenced project because it has changed. Actually, I think VS should notice the change itself, but failing that, we need a simple way to force a reload.
Any suggestions?
Edit: It is VS2005 and we are referencing output assemblies (the dll)
I had this problem once. Put both projects into a single solution. Right-click on the Solution in the Solution Explorer, and set the build order. Make the main project dependent on the .DLL. Now, when you rebuild the solution, the .DLL gets built first, and the main project will see all the changes.
EDIT: Also, reference the .DLL as a Project instead of selecting Browse when choosing a reference. Then, the changes should be immediately recognized by the main project without rebuilding.
Related
I have been working with many MVC4 projects with Visual Studio 2013, but only this project has the problem: the view page suddenly cannot realize the namespace (merely visual bug):
If I build the project, it's normal again (the namespaces and classes DO exist). It can be run or debugged fine.
The problem is that it persists, after I build, if I type something in the cshtml file for a while, or close and re-open the file, it happens again, and I have to build the project again. It also make Auto Indent (Ctrl + K, Ctrl + D) has problem if I don't build first.
How can I fix this?
FOUND THE PROBLEM:
It's because my DataContext also has a class named WispLink, therefore it cannot determine whether WispLink was a namespace or a class. I renamed the namespace WispLink to WispLinkNamespace, and it's ok now. Anyway, weird that it can still compile and run correctly.
I have found the problem.
It's because my DataContext also has a class named WispLink, therefore it cannot determine whether WispLink was a namespace or a class. I renamed the namespace WispLink to WispLinkNamespace, and it's ok now.
Anyway, weird that it can still compile and run correctly.
I need to reference in my project a dll library that contains a UI component. So I literally drag and drop it in solution explorer tab, then I add this code on top of XAML page:
xmlns:Banner="clr-namespace:(the namespace);assembly=(name of the dll file without extension)"
When I try to compile the solution, it says that the assembly was not found.
The problem could be build action of the dll? I tried setting the property to "copy always" and the build action to "resource", but with no luck.
Try to check these, common step i do when facing problem with third-party dll reference:
Have you added reference to that dll from your project? if no then add it, if yes check the following
in solution explorer > references, is the reference to that dll marked with warning sign (yellow triangle with exclamation mark in the middle)? if no, that means this is not a common problem, maybe the dll itself problematic or what i'm not sure in this case. But if yes, it means that the dll no more exist in the folder location where you reference it. Copy the dll to that folder location or remove that reference from project and add again pointing to folder location where the dll actually exist.
ps: Hope this help. And sorry if you already did all that before posting the question, all i know what you did is drag and drop the dll to solution explorer.
UPDATE :
After your comment i get what you are after actually. As far as i know, to be able to use dll in code you need to add it as reference in project. Thats why i suggested above steps, to make sure that the dll appears fine in references list in solution explorer. Drag and drop dll or any file to solution explorer only make it included in the project. And including file in project doesn't make it usable from code (except .cs/.vb file). CMIIW.
Just to start off, this question does seem very similar to another post Add the DLL (lame_enc.dll) reference to my project, but I haven't been able to successfully apply that answer. I am pretty new to VB.NET so it is very possible I'm simply missing something obvious.
I am trying to link a DLL to a VB.NET 2010 project to allow my VB app to play *.ogg files. I followed some other advice here on the forums and downloaded FMOD's FMOD Ex Programmers API. I am trying to now reference that functionality. These appear to be the files I need to somehow reference.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\fmodex64.dll.
C:\Program Files (x86)\FMOD SoundSystem\FMOD Programmers API Windows\api\libfmodex64_vc.lib.
I haven't discovered how to add a *.lib reference (or the equivalent), but selecting the DLL as a reference gives the following error.
A reference to 'C:\Program Files (x86)\FMOD SoundSystem\FMOD
Programmers API Windows\api\fmodex64.dll' could not be added. Please
make sure that the file is accessible, and that it is a valid assembly
or COM component.
I'm not sure what I could be missing. Any ideas? Thanks!
In Solution Explorer, double-click the My Project node for the project.
In the Project Designer, click the References tab.
Click the Add button to open the Add Reference dialog box.
In the Add Reference dialog box, select the tab indicating the type of component you want to reference.
Select the components you want to reference, then click OK.
Another approach I was trying is working for me. I found a site with a working example of a LibZPlay VB.NET sample ( http://planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7789&lngWId=10 ). It runs under VS 2008 and I was able to adapt my project to use LibZPlay (open source library http://libzplay.sourceforge.net/WELCOME.html ) under VS 2008.
That is sufficient for me for now. Thanks for your advice. It was likely some configuration issue or misunderstanding on my end.
Using VB.net 2015 I (could not add or even find a System32 dll) as a reference using Solution Explorer, Tab References. Going to the MAIN Menu, Projects/Add References...
Used Browse and All the System32 dll were visible. Then I was able to load the needed dll.
My question is on how custom controls should be updated.
I downloaded this owner drawn custom control, which I built, then copied the DLL to the Debug folder of the project and loaded it into the toolbox from there.
I decided to use this button on another project. I was mildly surprised to see the control was still in the toolbox but it seemed to work just fine. I decided to change this custom button's behavior. The button in the toolbox referenced the old version number. So I deleted it and loaded the newly rebuilt DLL.
Now come the problems. The first application--the one where the DLL was added to the toolbox from--still runs okay, but the second application is throwing errors, saying, Type 'CButtonLib.CButton' is not defined. When I add the button to a form, it appears okay. I can change its properties and it shows up in the code windows and in the object browser. But as soon as I try to run it and it throws the errors, it no longer appears in the object browser. References in the code window lose their intellisense.
Things I've tried include:
Copying the DLL to the project's debug and release folders and loading them into the toolbox from there.
Removing it from the toolbox altogether and just adding a reference then copying and pasting a button directly from the first project.
Copying in a form with a CButton on it from the first project.
Scouring the internet for answers
Swearing at the computer.
Nothing seems to work and I've now spent over a day trying to solve this.
I never did get to the bottom of this. In the end I simply had to recreate the entire custom control project using a different name. I suspect the way I added the original project to the toolbox of a different program – as opposed to adding it within the test project it came with – may have had something to do with it, but that's just a guess. Anyway, I can amend and update the new control without problem now, so all's well that ends well. :-)
I break my code modules up in DLLs alot.
When I add one of those DLLs to my project, how can I browse it's code to set breakpoints?
If you created the DLL, add the DLL's Project to your solution. You can do this by right clicking on the Solution at the top of Solution Explorer and clicking Add... > Existing Project
One solution can contain many projects. You set your executable as the startup project. You can then use Solution Explorer to find the Code in the Modules and do what you like, set breakpoints, make changes, etc.
Make sure the DLL is in your solution (assuming you use visual studio) AND is referenced by the process you are trying to debug. Then the execution should come by your breakpoints. IF NOT, you will notice the dot of the breakpoint is an empty circle.