I have built a class library project, that references a couple dll's. In the constructor of my class library project I use some enums from one of the referenced dll's. When using my class library in another project is it possible to not have to add references to my dll and the ones my class library project references internally?
...
I have a mystery on my hands. I am trying to learn managed C++ coming from a C# background and have run into a snag. If I have a project which includes two classes, a base class Soup and a derived class TomatoSoup which I compile as a static library (.lib), I get unresolved tokens on the virtual methods in Soup. Here is the code:
Abst...
Is there anyway to make it possible to use .net 3.0 namespaces in a .net 2.0 application? I'm specifically looking to use the System.Windows.Media.Media3D namespace.
Edit: I am looking to use the actual assemblies, not just the namespaces. Poor wording on my part.
...
I have data from a table in a database (string) that contain text and price. I extract the price from the data but my problem is that sometime I can Convert it to float and sometime not.
I have noticed that :
Convert.ToSingle(m.Groups[1].Value);
It works but not always because sometime the period is the problem (it requires a comma)....
I want to create a delegate type in C# inside a method for the purpose of creating Anonymous methods.
For Example :
public void MyMethod(){
delegate int Sum(int a, int b);
Sum mySumImplementation=delegate (int a, int b) {return a+b;}
Console.WriteLine(mySumImplementation(1,1).ToString());
}
Unfortunately, I cannot do it i...
We are scheduling a task programatically. However, the executable to be scheduled could be installed in a path that has spaces. ie c:\program Files\folder\folder\folder program\program.exe
When we provide this path as a parameter to the Tasjk Scheduler it fails to start because it cannot find the executable. It obviously needs to be enc...
I had a .NET 1.1 project, which I built in NAnt using the following snippet:
<property name="Refs.dir" value="Refs" readonly="false"/>
<property name="OAIDLLs.dir" value="OAI\bin\ServerDebug"/>
<solution
solutionfile="OAI\CC.OAI.sln"
configuration="ServerDebug"
outputdir="${OAIDLLs.dir}">
<assemblyfolders>
<includ...
I have a .NET 3.5 WinForms project that uses several 3rd party controls and a couple of home-grown components that are compiled for the 1.1 framework.
Is there a performance hit for using 1.1 components?
...
Now this is all way simplified, but here goes:
I have a User Control that consists only of a single *.ascx file. The control has no code-behind: it's just a script with a few functions, like this:
<%@ Control Language="VB" EnableViewState="False" ClassName="MyControlType" %>
<script runat="server">
Public Function MyFunction() As ...
I was going through some code and came across a scenario where my combobox has not been initialized yet. This is in .NET 2.0 and in the following code, this.cbRegion.SelectedValue is null.
int id = (int)this.cbRegion.SelectedValue;
This code threw a null reference exception instead of an invalid cast exception. I was wondering if an...
I've got this code in a pair of button click event handlers on a C# form:
class frmLogin
{
private const int SHORT_HEIGHT = 120;
private const int LONG_HEIGHT = 220;
private EventHandler ExpandHandler;
private EventHandler ShrinkHandler;
public frmLogin()
{
InitializeComponent();
ExpandHandler =...
I'm looking for a way in .NET (2.0, C# in particular) for source code to trigger a debugging break as if a breakpoint was set at that point, without having to remember to set a specific breakpoint there in the debugger, and without interfering with production runtime.
Our code needs to swallow exceptions in production so we don't disrup...
We've got a few pages in our web systems that use the .net system.net.mail control to send emails. The thing has been working great, except it's now starting to look like the smptclient class may not actually be disconnecting from the server, such that the SMTP server leaves that connection open, and we ended up maxing out the number of...
I need to intercept the console output stream(s) in order to capture it for a log but still pass things through to the original stream so the application works properly. This obviously means storing the original Console.Out TextWriter before changing it with Console.SetOut(new MyTextWriterClass(originalOut)).
I assume the individual op...
If the Master Page and child aspx page are in different folders, when the aspx page is served, whether image paths are relative to the location of child page or the Master page?
...
We have an issue on our page whereby the first time a button posts back (we have ASP.NET ajax to enable partial updates) nothing happens, then on every subsequent click, the information is updated as if the previous event fired.
Here's the code for the page. The events are button clicks fired from within the table. Which is rerendered a...
I have an assembly that is targeted for .NET 3.5.
I have an application targeted for .NET 2.0 and wonder if I should have any trouble referencing the 3.5 assembly from the 2.0 application.
I understand that the IL is supposedly the same, so I'm assuming that it will work, but would like to hear some experiences from others who have tri...
I've been searching around for this and cannot seem to find a solid answer. I know the 2.0 version of the .net framework is supported in Windows98, but does that include SP1?
...
I am running C# framework 2.0 and I would like to get some of the data from a list? The list is a List<>. How can I do that without looping and doing comparaison manually on each element of the List<>?
...
A simple application is written in CF 2.0. It's single-threaded as far as I'm concerned.
Two parts of the application are of interest: an event handler that handles "Barcode scanned" event raised by a class that represents PDA's barcode scanner (provided by manufacturer), and an event handler for Windows.Forms.Timer that runs every 30 s...