What is the protocol to share a namespace between two projects when consequential projects will reference both of the namespaces?
Obviously this is possible (System, mscorlib)...
I've gotten different errors depending on the things I've tried. Right now I have two projects Blueprint and Domain that share the MainApp namespace (for ins...
The biggest problem I'm having so far with MEF is that when I compose parts in my plugin loader wrapper, loading completely bails when it finds an import resolution problem with one of the assemblies. Ideally, I'd like ComposeParts to exhibit some sort of "ignore and continue" behavior, because the ideal user experience would entail loa...
Hello,
I have one class library that have all functions declared as public under public class.
Still When I am going to call one of those it gives linker errors. Do I need to export these methods explicitly from class library as we export from native dll. When I export with __declspec(dllexport) it says that function cannot be exported ...
I have 3 .net Lists items, I need to merge them all into one, to order them and bind them to a datagrid. However, I need a way of indicating which original list each item came from, so that I can identify this in the datagrid (change color or font etc).
Can anyone suggest the best way to do this?
...
I have an app with a manifest that requires running as administrator, but part of the app is to map a drive using WNetAddConnection2 which I believe requires it to be run in the normal user context due to credentials etc. Is there a way to execute this bit of code in the normal user context without creating a separate process.
EDIT
Fro...
Yesterday, 2 of the 3 drives in my dev server's RAID 5 decided to die on me (with no warning). I've come to grips with the fact that my data is most likely lost unless I shell out some major bucks for professional data-resortoration. People, don't be an idiot like me and treat your RAID as a data backup!
Luckily I published the site abo...
Here is the input data:
*** INVOICE ***
THE BIKE SHOP
1 NEW ROAD, TOWNVILLE,
SOMEWHERE, UK, AB1 2CD
...
I might be wrong, but it looks like that there's no direct flex/bison (lex/yacc) port for C#/.NET so far.
For LALR parser, I found GPPG/GPLEX, and for LL parser, there is the famous ANTLR. But, I want to reuse my flex/bison grammar as much as possible.
Is there any direct port of flex/bison for C#?
What lexer/parser people normally ...
With the new dynamic capabilities in .NET 4.0, it seems like it should be possible to dynamically implement an interface, e.g. given:
public interface IFoo
{
string Bar(int baz);
}
public class Foo : IFoo
{
public string Bar(int baz) { return baz.ToString(); }
}
public class Proxy : IDynamicMetaObjectProvider
{
private re...
Sometimes I need to develop a simple database application using MS Access Databases.
I`ve learned that I can manipulate data in my tables using direct SQL Commands or gather everything in a DataSet and update any changes that it tracks (insert, delete...).
But the question is: should my app make changes is my database tables using dire...
I'm currently working on a class which exposes an internal List through a property. The List shall and can be modified. The problem is, entries in the internal list could be set to null from outside the class.
My code actually looks like this:
class ClassWithList
{
List<object> _list = new List<object>();
// get accessor, whic...
I am new to Linq to Entities and I am trying to insert a record using the linq syntax.
I have created the edmx file and instatiated it in a class with:
PasswordEntities db = new PasswordEntities();
I have a method that looks like this:
public void InsertRecord(Password record)
{
db.AddToPasswords(record);
}...
Hello,
I need to run Dos commands within a class. My problem is that the redirect options seem to prevent the command from running.
Here is my code:
public static int executeCommand(string cmd)
{
System.Diagnostics.ProcessStartInfo processStartInfo = new System.Diagnostics.ProcessStartInfo("CMD.exe", "/C " + cmd);
...
Hi!
At my current project(huge enterprise system) I'm faced to scenario when "simple" objects like table, reference list are created at runtime via system info stored in the same DB(special sys tables). Users can create those simple objects and relations between them.
The complicated objects are created by developers. For the first case ...
In Anders Hejlsberg's .NET 4.0 presentation he discussed in NET 5.0 ("or some future release") they are working on a "Compiler as a Service" model.
Anders Hejlsberg's states: [source][1]
"We want to open up our compiler so it becomes an API you can call to compile a piece of code and get back expression trees and/or IL. This enables a w...
When i try to create good object hierarchy which will help to write less code and avoid to use unnecessary fields ,i feel myself free to create many base classes for good grouping which is usually abstract.
What can be disadvantage of doing it like that ? Many times inherited class can be slower ?
To see many unnecessary abstract classe...
I would like to know if there is a function in .NET which converts numeric bytes into the string with correct measurement?
Or we just need to follow old approach of dividing and holding the conversion units to get it done?
...
I was wondering which type would have better performance and which you think should be used.
For example I have a List of strings not knowing how many items I will need so having the .Add(String) function is really convenient. I can Add new strings to the list at any time easily.
What are the advantages/disadvantages of using each?
A...
I'm trying to achieve bi-directional, named pipe communication on my Win-XP workstation using two simple C# forms solutions. One for the client and one for the server. They appear almost identical and use NamedPipeServerStream and NamedPipeClientStream (.NET 3.5). Both client and server are set to bidirectional comms via PipeDirection.In...
Is it possible for a .NET web service to accept an immutable object (or an object containing references to immutable objects) in a web method?
For example, if this is my web service method:
public class MyWebService : System.Web.Services.WebService
{
[WebMethod]
public void SetStatus(StatusData data)
{
// do somethi...