C# - Sharing Code Between 2 Projects Without A Dll
Dec 2, 2010
How can I have code-sharing between two projects without making a dll?
The issue is: I have a tool that syncs users & groups from LDAP to a database.
Now the tool is a windows service, but testing it as such is very difficult and time consuming.
Which is why I made a console application where I can test the LDAP syncing, and then just copy the respective sourcecode-files over to the service project.
But... keeping the common files in sync is a bit of a problem. I don't want to make a dll, because this probably creates me a problem with the 3rd project, a windows installer (for the service) where I have to use ExecutingAssembly path...
Is there a way to share the code without making a separate dll? Automagic statical linking, so to say ?
View 6 Replies
ADVERTISEMENT
Jul 22, 2009
I am working on a solution that contains 2 projects one to be built as an exe and the other as a service. Both projects will share a class for certian functions and properties. I would like to have both projects use the same physical file so when I make a change in one of the projects it is also made in the other.
This was simple to do in VB6 but as of yet I see no way to do it under dot net. It seems to want to make a copy of the file and place it into the project folder for the second project resulting in the need to either copy after every change or manually make the changes twice.
Anyone know if there is a way to have common files area for a solution so that any project within the solution has access to the actual file rather than a copy of it?
View 2 Replies
Jul 12, 2011
I want to use a form in two project.
I have developed it in one project, I now want to make it available to another project.
I have removed it from the project and moved the .vb & *.resx files to a directory for common modules.
I then go into my project select Add Existing item, select the .vb project and say Add as Link.
But now my form is missing - I just have the code.
I have two classes MyPanel & MyForm. MyForm was first, MyPanel second. It says they should be the other way round. When I swap them I get the message "to add componets to your class, drag them from the toolbox...."
View 1 Replies
Nov 23, 2011
I am currently developing a Windows service and I am am looking to use MEF to compose all of the services components at run time. The data access module (project) is using Entity Framework 4.1 and a Domain Service Class to perform CRUD operations on the entity model.
The problem I have is how to share the models outside the DAL project when composing the DAL into the worker class in the main project.
For exmaple this is one of the methods in the DAL contract interface
Function GetInspectionFaults() As IQueryable(Of InspectionFault)
This interface is currently in the DAL project (not the shared/referenced project containing the other contract interfaces) as it needs references to the entity model for the POCO types.
How do I shared these POCO types?
View 1 Replies
Jun 11, 2011
I have a windows forms application with one exe and several dlls(Class libraries) in a single solution. The application uses common data that is used across all the dlls. I would like to load the data when the application is starting up and use the loaded data at various points in the dlls so that I do not have to load the common data again and again. How can I share the data loaded in main EXE across the DLLs?
View 2 Replies
Jun 2, 2010
I have 2 seperate web services. They both run on the same machine.One of the functions is the same between the 2 web services. It is a huge function and i hate having to repeat code. Is there any way to share the code between the 2 services other than having one service request the function from the other service? I'm a bit hesitant doing it that way because im worried about performance. It would mean for each request into service A i'd need to create a service B instance and call it.
View 5 Replies
Mar 14, 2011
i have one project (let's call it project1) that is going to add properties to another project's class. The thing is I wanted to make it automatically. So in my project there are two lines of code which I want to add at the bottom of the class.vb or class.cs in a project called project2. Is it possible? If so, how?It is a data access builder software which after adding some new columns to our database we use it to generate its properties and its parameter to be added in BLL. Since we do it often (changing our database structure) I did not wanted to copy data from data access builder software and add it to project2 manually.
View 3 Replies
Jun 7, 2010
I have a working Windows Forms app (split into an EXE and a few DLLs). Now I've been asked to look at creating another app (MyAppLite) that has only a very small subset of the functionality. Think of it as similar to MS Word Viewer vs. MS Word.
Everything that I need to build MyAppLite is contained in the main solution - essentially I need to use a couple of the WinForms and whatever bits in the DLLs they call into.
What would be the best way to do this?
I was thinking of creating another Project in my solution for MyAppLite, then adding the necessary source files as links (using Add Existing Item > Add As Link in Solution Explorer).
I definitely wouldn't want to maintain 2 copies of the source code. FYI it's a .NET 2.0 VB app, using VS2008.
View 2 Replies
Mar 12, 2011
This question is more out of curiosity than a project requirement or a problem.I have a Non-CLS compliant code in one language (say C#), and I need to use it like that only in my current language (across projects, so making internal is not a choice), and at the same time want to allow other languages (say VB) to be able to call the conflicting implementations without generating compile time error.
For instance,
//C#
public class SecurityService
[code].....
View 3 Replies
Nov 16, 2011
Is there a way that I can include code or other files from other projects WITHOUT referencing them? I am trying to combine our projects into 1 EXE without DLLs. I do not want to use a self extracting EXE either. Let me know if there is a way to do it similar to the C++ #Include.
View 5 Replies
Feb 11, 2010
I recently inherited a nice size projects with about 100k lines of code and would like to find out what code is actually being run. I've found a number of routines that are not called at all and looking for a fast and automated way to explore the Business Layer to see what other code can be refactored out quickly.
This is an ASP.NET website with VB.NET codebehind and Business Layer.
View 4 Replies
Oct 23, 2010
The file 'C:Documents and SettingsMirkoMy DocumentsVisual Studio2008ProjectsWindowsApplication1WindowsApplication1Form1.vb' does not support code parsing or generation because it is not contained within a project that supports code.
Instances of this error (1)
1. Hide Call Stack
at
[code].....
View 3 Replies
Jun 12, 2009
In the "old days" I was working with Linux to create C/C++ programs (really really BASIC...HA!...programs, just learning to program in the courses as an intro) by creating a text file with the source code that was then fed to the compiler/linker that then spit out the executable binary.
[Code]....
View 2 Replies
Oct 16, 2011
I have 2 projects
UI
Functionality
UI references Functionality to call specific functions. Functionality needs to call certain functions that operate UI. This is what I mean by Duplex communication. Is there any way to do this without causing circular dependency?Should there be 1 main project which simply does all the calling acting as a "wrapper" between UI and Functionality?
View 2 Replies
Mar 15, 2009
Removing projects from VB2008 start page recent projects list. The above list is getting clogged. How do I remove items from this list?
View 3 Replies
May 31, 2011
I'm running Visual Studio 2010 on a terminal server, and have been, with relatively few problems, for some time. This morning I fired up my PC and over the UK's long weekend, the following issue seems to have developed.I've got a bunch of projects (but not all of my projects, and not all of the projects in a given solution) complaining that a particular file (which does not exist on the computer) cannot be opened, and so those projects will not compile anymore. Here's the error:
Error 31 Unable to open module file'C:Users[username]AppDataLocalTemp2.NETFramework,Version=v4.0.AssemblyAttributes.vb':
System Error &H80070003&
I could simply copy the file into that directory and be done with it, I'm pretty sure that will work,EDIT: Okay, now things have gotten to a whole new level of weird. I've rebooted the server, I get the same error message, only now the file it is asking for exists and can be opened in Visual Studio with no problems. another part of the IDE still insists that it's unable to open the module file.
EDIT 2: Can't delete the file because it claims to be open in another program, but I've logged off and logged on again, and there shouldn't be anything accessing it.
EDIT 3: Because there's a wall of comments below his answer, I'll mention here that Jared's suggestion to delete the SUO file for the solutions having the problem (not files specifically to do with any of the problem projects, strangely) was what solved this, eventually.
View 2 Replies
Jun 6, 2011
We are given a task to create a software that can share files between two computers without using lan (internet connection) but the presence of hardware devices can be used like cable, rs232, usb to usb or can be bluetooth to bluetooth file sharing. We searched about file sharing without using lan. The result was "socket programming". Is socket programming is applicable for vb.net? If yes, how is it program?
View 1 Replies
Jul 10, 2011
how to make projects which span multiple files and classes just fine. I've had big multi-file things working.I've been told explicity that my classes have to be private...yet at the same time I'm supposed to have a main method elsewhere and somehow call a menu in my main working file.I can get the program working perfectly when I do it in a logical manner but I just can't figure out how to call a private sub. I keep getting the error reference to a non-shared member requires an object reference.I've tried breaking the rules a bit and making one initial sub which is public, shared, etc... but all this does is delays the error until it tries to call its first private sub.
View 3 Replies
Jul 13, 2011
I'm doing my dev work on a Window 7 x64 machine, deploying to a Windows 2008 x32 server. At the moment I'm adding WCF services to some internal apps so that we can build smaller clients using net.tcp bindings that report to the user what the server is doing without running multiple instances of the server. To cut back on how much administration the apps will require, I tried enabling port sharing on my first server app. I'm using the app to self-host the WCF service so they can be easily moved from one server to another if necessary. Here's the code starting the server:
Dim _service_host As ServiceHost
Dim active_server_address As Uri = New UriBuilder("net.tcp", "localhost", CInt(My.Settings.ServerPort)).Uri
[Code].....
I get the following error when I put a breakpoint at the last line: Unable to automatically step into the server. Connecting to the server machine 'nettcpportsharing' failed. The requested name is valid, but no data of the requested type was found. The Try...Catch block housing that code says the exception type is AddressAlreadyInUseException...but when I run netstat I don't see anything else listening on that address. There's no occurrence of 'nettcpportsharing' anywhere in my solution. I've checked to make sure that the Net.Tcp Port Sharing service is started.
View 1 Replies
Jun 10, 2011
I am working on developing p2p chat system and also file share system....But only thing is that ...i can't find out the way to find how to implement it...i have worked on client server programs but i m not able to get p2p...The concepts of P2P are:-
1. All nodes connected can act both as server and client depending on requirement....
2. They can connect to each other find file who is the owner of file and then ask for file....
View 1 Replies
Nov 17, 2009
I am working with several RFID readers that perform different function in my vb.net program. Currently each reader port number is hard coded into the respective form. For example, reader 3 operates on COM1. However, this will be problematic when installing on different machines.
What I would like to do is have a "configuration" form where the user can select each reader and then select the COM port. Then all other code references these settings. What would be the best approach for this.
The only way I know to do it currently is to place this information in a small database and then have the forms reference that database, but it is a lot to do for such a seemingly trivial task.
View 3 Replies
May 11, 2009
I have to implement some way of communication between 2 applications:
Program 1 is receiving data at a relatively high rate (sometimes up to 100k in a second). This application receives the data, does only very few computations and saves the received data to disk for later in-depth-analysis or just recall.
Program 2 shall do some real-time analysis on the same data which may at some point become rather complicated.
It is necessary to split up the 2 tasks into separate programs because the data has to be saved under all circumstances and without losses. Program 2 is still in a development phase, it has to be improved, recompiled, debugged. This shall not disturb the data collection and archiving.
Since application 2 has to go through all the data that program 1 receives it would be slowing down everything very much if the programs had to communicate e.g. via TCP. Therefore I am looking for ways to have some shared memory or whatever else might make it possible for P2 to access the data collected by P1 without too much overhead.
View 12 Replies
Aug 16, 2010
Problem with WCF and Multiple Namespaces.The major difference I am having is that I don't control both ends of the wire.My setup is similar to this:[code]The first thing you do is login via the login service and receive a security ticket. The ticket object is located in the My.Objects namespace. For each subsequent call in My.Service1 and My.Service2 you have to pass in the security ticket to authenticate the call. The issue I am having is that instead of the client (a .net one for now but Java and others in the future) seeing one My.Objects.Ticket the references are resolving as My.LoginService.Ticket, My.Service1.Ticket, and My.Service2.Ticket. When the client tries to pass the object retrieved during login to any other function it is receiving an object mismatch error.How can I make each service resolve objects to the My.Objects namespace?
View 3 Replies
Apr 12, 2010
I have some icons and images that are stored as embedded resources in my form1.resx file. Is there any way I can access these resources from my Form2 without adding the icons as project resources?
View 5 Replies
Sep 9, 2008
How do I share text between forms?I want a box to popup exactly like a input box, but needs to be multiline, Is there any east way to do this or will I have to create a second form?If so, how do I share the string between forms to then output in a textbox on 1st form?
Also, I have VB 2008 Standard, and I want to build an application for a handheld, Is it possible to build an application and then pass it over to someone who has the professional version to make it work on pocket pc? Or does the entire build have to be on pro already?It's a very simple program...
View 4 Replies
Jan 25, 2012
I am trying to figure out how to seperate my business logic from my forms. This is my first attempt at doing this, but I would like to figure out how to handle events from multiple forms within a class. I have found myself routinely writing the same logic over and over in each form class and its time I figure out how to completly seperate out that logic in winforms so I can reuse the methods across all of my forms.
So basically I have this click event in form1:
Private Sub btnSubmit_Click(sender As System.Object, e As System.EventArgs) Handles btnSubmit.Click
[code].....
View 1 Replies
Jul 31, 2009
When I declare a variable as public, shouldn't it be available in another form? I am trying to write a windows mobile prg with 12 static mileage points, form1 has the 12 buttons for start point, but when I call form2 with the destination points, my start variable value is not carried over. I intend to then assign a mileage based on the two points and write to file on mobile device. We support 12 schools, and I want my employees to track mileage easily.
Public Class main
Public start As String = "start"
Public dest As String = "dest"
Public miles As Decimal = 0
[Code] .....
View 4 Replies
Jun 16, 2010
i've almost completed my Yahtzee game except for the high scores function. I've got everything worked out except how to take the highscore variable from Form1, and share the data with Form 2
View 12 Replies
Feb 11, 2011
I have two comboboxes. Depending on what is selected in the first combobox, I want the second combobox to display a different field from a different table within the same database (.mdb).Is this possible?I have the following code, but I get a "Complex DataBinding accepts as a data source either an IList or an IListSource." Error when running the code.
[Code]...
View 5 Replies
Feb 14, 2011
I have a database (.MDB) containing several tables. I also have two comboboxes on a form. I would like to populate the second combobox with a field from one of several tables in the database based on what the user picks in the first combobox.
So... if the user selects Option A in the first combobox, then the second combobox would be populated with contents from a field in table A. If the user picks Option B in the first combobox, then the second combobox is cleared of items from the table A, and repopulated with contents from a field in table B.
I basically created the comboboxes on the form and set the DataSource and Display member of the second combobox through the control's properties. The TableAdapter (is this the corrector terminology) was created automatically by the IDE. I have tried using the code below to switch the tables, but I get an error: "Complex DataBinding accepts as a data source either an IList or an IListSource."
Select Case strTagPrefixTable
Case "BLT"
cboBLTFmt2.DataSource = ECDT_C_V_BOLTSTableAdapter
[Code]....
View 4 Replies