Reference A File That Was Included In The Project In .net?
Apr 9, 2010in which directory is an image copied when you include it in your project?
View 1 Repliesin which directory is an image copied when you include it in your project?
View 1 RepliesI would like to refer to an image i have added to a project from inside a class of the same project.
View 2 RepliesWhen you add a file that the project will use (in my case an Excel file) and set it to be copied to the output directory, you can of course add a string to a class with the file name in it to use the file. I was wondering though does Visual Studio automatically generate a member somewhere that contains the name of the file? Perhaps in the My Namespace?
Kind of like how when you set the Build Action to Resource, Visual Studio generates a member in the My.Resources namespace for reference. Whenever I change the name of the file in the Solution Explorer it would be nice if I had some method that would automatically update the file name in the code.
I have added an XML file (File.xml) into a project (I can see it in the Solution Explorer), it resides at the root directory level of the project i.e. the same level as the VB program (.vb), the bin directory and the References directory etc..
[Code]...
I include 2 exes in my setup project which share dlls. In 2008 this just resulted in warnings when building but I now get an error instead indicating that the file is already included.I can fix this by excluding them but they will reappear after each build so have to be excluded again which slows the process down - example error message is below:
Error 14 Two or more objects have the same target location ('[targetdir]interop.excel.dll') C:DevelopmentPIMSPIMSSetupPIMSSetup.vdproj PIMSSetup
Alone form proxy.vb is working without problem, but when I copy it and include to my project I getting always:
Exception:Thrown: "Index and count must refer to a location within the buffer." (System.ArgumentOutOfRangeException)
[code].....
I was able to include (add) an existing project to a current one. I finally got all the references and libraries in place, and everything works great. I decided to move forward with development and started adding some features...much to my surprise, when I debug none of the controls are there (In the form belonging to the added project)...
Do I need to develop the second project from it's original solution (and not from within the combined solution)?
I made a setup project and added a folder for desktop shortcut. My application includes database file as well. When I installed the application and ran the shortcut from desktop, it gave Desktop's path and said ABC.mdb not found.
View 2 RepliesFollowing a move away from Desktops and onto Terminal Server machines, I'm having to recompile a number of projects created by my illustrious predecessor at the company.One of these projects is a fairly simple WPF MVVM project, with an error-reporting component added as a referenced project, i.e. the reference is to the project, not to a DLL. Both of the projects were started in earlier versions of Visual studio, but both now target framework 4.0 and are being maintained in VS2010.The whole thing compiles fine, but at runtime I get the following error:
Could not load file or assembly 'companyName.Tracer, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=0156bfd00d8c2368' or one of its dependencies.The located assembly's manifest definition does not match the assembly reference.(Exception from HRESULT: 0x80131040)
The referenced project is signed with a .pfx file, though I have tried compiling with and without the signing, and it appears to make no difference.I'm not sure where "Version 2.0.0.0" is coming from. The referenced project is at version 1.1.* and the main project is also at 1.1.*.Presumably I'm missing something obvious, or I've failed to include some vital piece of information, so I'll try to respond to any requests for additional information as quickly as possible.
With Visual Studio - 2008. I publish to my server. I have problem with the ClickOne, I cant find a way to include my DB connection and resources folder included in my project. It update correctly, but it does not include my resource folder a database connection. Maybe something with the rights to connect to the DB. Can can also see that every time I update my application, it make a new folder but it do not input my folders.
Any right way to do this:
Dim con As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=" & "Resources/" & "myDB.mdb")
This is my string to connect. And I have added "myDB.mdb" it to my resource folder in the project. I have followed this video: [URL]. What is the correct way to implement a DB connection to my project when I am using ClickOnes?
I'm trying to load a project that I lazily saved all for. When I try to load the project from the vb start menu it says I can't load it because it has a reference to a file.
View 4 RepliesI have a simple vb.net project that outputs a dll. In order to build this project, I have to reference some 3 3rd party dlls by manually adding them to the project and then building.
What I want to do now is auto build this using a app called CruiseControl. . . I have been told that in order to use the 3 3rd party dlls, I have to modify the .proj file to include the .dlls. The thing is, where in the proj file do I include this
and how do I do this? I think I may know where the section is and I have included it here:
[code...]
When I run the auto build program it fails (it runs through but fails at compile time); when I build this manually it works when i refer the dlls. What am I missing to make this work?
If I have a .dll, isn't it I can place it in a folder providing that the folder is included in the project? since I really do have a problem during publishing.
View 4 RepliesI'm developing application that is plugable. The plugins are loaded via Assembly.LoadFrom(). In my solution I have 4 projects. A WPF, 2 DLL and another DLL that is a plugin for the app. The plugin project references one of the other DLLs. When I build the Solution and run I was getting an error trying to use the plugin dll because it was expecting an older version of the referenced project. I had to clean and rebuild the plugin project to get it to run correctly.
[Code]...
I am including a file in my project where the BuildAction is content and Copy to Output is Copy Always However, when I publish and give the user a way to copy the file to another directory I keep getting File Not Found.The code looks like:
View 3 RepliesI am newbie here and sorry if I post at wrong section if I did it. May I know how to do that in vb.net? I try response.addheader but it seems this can only work but cannot save the image file to my document.
View 3 RepliesI have 2 projects, one built in VB.NET and another in C#.NET. I want to use certain functionality of VB.NET into C#.NET and hence I have added the dll file of VB.NET solution into C#.NET as a reference by browsing the dll from my system. Say dll name for VB.NET is myData.dll. In my C#.NET project I am trying to declare it as a namespace i.e. "using myData;" and its giving me an error of "Type or namespace name could not be found"
View 1 RepliesPublic Class aaMyForm Inherits Windows.Forms.Form Added some controls. Build it, add the .DLL as reference to my other project.
In my other project:
Imports MyLib
Public Class XForm
Inherits aaMyForm
The events from aaMyForm execute correctly but the controls added to it are not shown on XForm. I have found some info about set Modifiers Protected in order to be able to change the functionality of the controls but havent found anything about why the controls aren display on the XForm.
When I try to add a .tlb file to my project as a reference, I keep getting this error:
how to fix it, or turn the .tlb file into a normal .dll file which I can then add to my project?
I have received a project from other developer. This project as serveral references which are alright.There is only one reference that is not good.It's the Microsoft visual basic PowerPacks. I have the dll in the place where the other ddls are but still the project says that it can not find the reference specified.The DLL name is: Microsoft.VisualBasic.PowerPacks.dll it's on the path: C:Documents and SettingspribeiroAmbiente de trabalhoSGLCBuild I have other dlls there that are with the right references on the project...
View 18 Replieshow can I add a class of a different project to my current project as a reference?I tried Right click_-> add existing item --> ( The class from the other project) then it gives me error.I am not sure how can I use that class as my reference to my current project?
View 3 RepliesWindows 7 (64 bit); Visual Studio 2010
Project 1: Control Library and Builds ok
Project 2:Windows Forms Application
Code refers to Project 1 as "Dim withEvents name as New Global.name.name
Add Existing Project 1 .vbproj file
Add Reference and Select Prject 1 .vbproj file
The attached information message appears.Project 2 runs but not properly.
I need to convert all types of audio formats to the mp3. I think I need to add the refrence of the dll (lame_enc.dll) into my .net application. When I try to add the DLL reference to my project, I get an error: "A reference to C:Lame_Enc.dll could not be added. Please make sure this file is accessible and that it is a valid assembly or COM component"
[Code]....
I am very very very Curious , okay today when i opened vb.2005 i click on projectAdd ReferenceCOM(tab)
It showed me different component names, so here is my question
What can i do with those Components? I saw Yahoo Messenger Components/ Bit torrent/ Real Player/ Quick Time and different applications' component to summarize my curiosity
What can i do with them? What is the reason for those components? Are they helpful? Are they ever needed? if yeah please how?
i tried to customize the column name because the column name in my datagridview comes directly from the table column name, which is kindda odd. i browse throught this forum and other forums on howto's but i get this wierd error. [code] tablestyles is not a member of system.windows.form.datadridview.do i have to add additinal reference to my project?
View 6 RepliesWhen I'm adding project reference to a project in VS2010, VS is unable to refer it in the project,
but when I'm adding the dll path (by browse), VS is getting the reference and project is working fine.
I'm using VS2010 professional edition and both the projects are in .NET Framework 4.0.
I'm trying to use the dotnetbar reference in my project..However I'm getting this error messages..I haven't got a clue what's wrong :S
View 4 RepliesI have a vb.net 3.5 class library project that needs to reference two assemblies that have the same namespace. We have two third party dll's in which one is version 5.1 and the other is version 6.1. They have the same dll filename and they utilize the same namespace and functions/class names. The project needs to use one or the other depending on a specific situation. I've investigated up on a c# process that uses the "extern alias" feature to pull in the different assemblies.
[URL]
What use is the Aliases property of assembly references in Visual Studio 8.It seems that this feature isn't fully available for vb.net. Things I've Tried I've renamed the 2nd dll and added both references to my project. At this point I get tons of: 'blah' is ambiguous in the namespace. So I need to alias the different versions. In vb.net you can do aliases on an imports statement like:
Imports version5 = Somedll.Something
The problem is I can't setup an assembly reference alias for the different versions of the dll. Apparently in vb.net you can't set these up in the reference properties window. So I tried setting them in in my project file like this:
<Reference Include="somedll.5.Navigation">
<HintPath>....UtilityThirdPartyDLLSsomedll.5.dll</HintPath>
<Aliases>SomeDLL5</Aliases>
[code]....
I would then expect this to work:
Imports version5 = SomeDLL5.Something
Imports version6 = SomeDLL6.Something
But the "SomeDLL5/6" doesn't show up in intellisense. So how can I reference both dll's in the same project?
In a VB.Net project, you can use the Settings tab of the properties page to define application settings. To reference the settings in code, you use the syntax My.Settings.SettingName in VB.
On the Settings tab, you get to choose the Access Modifier. It may be "Friend" or "Public". Presumably, when you choose "Public", you are making the settings accessible to other assemblies. However, once "Public" is chosen, I can't figure out the syntax to reference the settings of one project from another. In fact, I can't observe any difference between using "Internal" vs. "Public" as the access modifier.
My question: Does choosing "Public" as the access modifier make settings accessible to other assemblies? If so, what is the syntax to reference the settings from other assemblies? If not, what does "Public" do?
Does anybody know how to add reference of ADO in VS.net 2008?
View 4 Replies