Recent update: 2008-3-21
Error 1 'TexasHoldemCalculator.Card' does not contain a definition for 'equals' and no extension method 'equals' accepting a first argument of type 'TexasHoldemCalculator.Card' could be found (are you missing a using directive or an assembly reference?) ...
What is the thinking around letting C# infer generic type params when returning from a method? I'm sure I'm not explaining this right, so let me demonstrate: Code Snippet static int Foo(){ return Bar();}static T Bar<T>(){ return default(T);} It seems to me that in this case, the ...
697 byte By
nikov at 2008-3-5
I've installed Orcas and began to play with lambdas and expression trees.Is it allowed to use 'nested' exression trees?I mean: Code Snippet using System;using System.Linq;using System.Linq.Expressions;namespace Nikov.Linq{ using Expr = Expression<Func<int, int>>; class Program ...
When I goto Database Explorer Data Connections Add Connections I get an error message: "The event log file is full" I don't know what event log file it's talking about, where that file is located, and how to clear the file
I'm trying to create managed WMI provider using new classes provided by System.Magement.I do the flowing: Code Snippet [assembly: WmiConfiguration("Root/WmiResearch", HostingModel = ManagementHostingModel.Decoupled, IdentifyLevel = false)] Code Snippet using System;using ...
1572 byte By
-Matt- at 2008-2-28
Hi, I'm attempting to port our 60+ project solution from Visual Studio 8 to 9. Still targetting .Net 2.0. Have downloaded the most recent VHD. Converting the solution and projects to the new version was error free. But when I compile it hangs roughly half way through. In particular. 1. ...
Hi...When er implement a abstract class automatic from Orcas i get this code: protected override int SomeInt() { throw new Exception("The method or operation is not implemented."); }but why not use: protected override int SomeInt() { throw new NotImplementedException(); }It would be ...
1572 byte By
-Matt- at 2008-2-26
Hi, I'm attempting to port our 60+ project solution from Visual Studio 8 to 9. Still targetting .Net 2.0. Have downloaded the most recent VHD. Converting the solution and projects to the new version was error free. But when I compile it hangs roughly half way through. In particular. 1. ...
Code Snippet CSharpCodeProvider provider = new CSharpCodeProvider(); [...] provider.CompileAssemblyFromFile(...) doesn't work with C# 3.0 code. It is normal because CSharpCodeProvider is defined in Framework 2.0. How can we do this with C#3.0? ...
Hi, I was wondering whether it is possible to instruct LINQ to treat a projected anonymous type as an implementation of an interface? This would be useful for allowing a query result to be passed around to other functions, for example. What I would like to see is something like this. ...
445 byte By
sj_h1 at 2008-2-23
In all new forms the "using System.Linq" is included automatically, however, it causes the error: Error 1 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) D:\C#\PPTestApp\PPTestApp\frmCmdC10.cs 6 14 PPTestApp ...
The subject says it all - why doesn't have the Directory(Info) class no copy method? That's a feature what should be since 1.0. In VB you can solve the task via the My-object but why isn't it implemented in the BCL?
In 2.0, it was not possible to point a delegate to a property getter. There were workarounds, but none of them particularly elegant.Although that restriction doesn't appear to be lifted in c# 3.0, one new type-safe workaround is to use a lambda with no arguments: Code Snippet var foo = new ...
452 byte By
Dmitry at 2008-2-21
Hi, Just noticed, if I create any WF project via the wizard, any C# 3.0 intruction results in compilation errors. This is despite the fact that project properties say that it is compiled against framework 3.5. And if I bring in some WF stuff into any framework 3.5 application (with C# 3.0, ...
I have this code: Code Snippetpublic static class StringExtension{ public static string Format(this string template, params object[] parameters) { return string.Format(template, parameters); } } Code Snippetstring s = StringExtension.Format("{0}", "toto"); is ok. But ...
[ Running Orcas Beta 1 on VPC 2007, Vista 32 bit guest, Vista 64 host, ASP.NET futures also installed.] In a Page_Load method I have ... { NorthwindDataContect db = new NorthwindDataContext(); var query = from o in db.Orders where o.ShipCity == "London" select o; ...
[ Running Orcas Beta 1 on VPC 2007, Vista 32 bit guest, Vista 64 host, ASP.NET futures also installed.] In a Page_Load method I have ... { NorthwindDataContect db = new NorthwindDataContext(); var query = from o in db.Orders where o.ShipCity == "London" select o; ...
494 byte By
Muzzzy at 2008-2-17
Hi,Sometime ago i installed Visual Studio extensions on Visual Studio 2005 and was able to create WPF projects. Then, yesterday i installed latest Orcas CTP on top of that and when i try to create a project i don't see an option for any of .NET 3 projects (WWF, WCF, WPF), but i still can ...
I've been trying to find the Notification Icon control so I can make a tray icon in the taskbar. Can anyone point me to where it is, or at least a way to work around it?
When I goto Database Explorer Data Connections Add Connections I get an error message: "The event log file is full" I don't know what event log file it's talking about, where that file is located, and how to clear the file
445 byte By
sj_h1 at 2008-2-15
In all new forms the "using System.Linq" is included automatically, however, it causes the error: Error 1 The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?) D:\C#\PPTestApp\PPTestApp\frmCmdC10.cs 6 14 PPTestApp ...
I downloaded the Visual Studio Orcas March 2007 CTP but when I double click the VSCTPBase file to install it on Windows Vista, I get an error "The parameter is incorrect" Any ideas?
452 byte By
Dmitry at 2008-2-15
Hi, Just noticed, if I create any WF project via the wizard, any C# 3.0 intruction results in compilation errors. This is despite the fact that project properties say that it is compiled against framework 3.5. And if I bring in some WF stuff into any framework 3.5 application (with C# 3.0, ...
I dragged the Customers table to the Linq to SQL Designer. The designer generated a code for a Customer object. How does it decide on what name to use (in this case Customer)?
Hi, I apologize if this is not the right place to post this question. If you know of a more appropriate forum, let me know.I need to create a build of our product for .NET 3.0. Currently we compile it as a "Class Library" project in VS2005 and get an assembly. The assembly is deployed ...
This is my first time to open a database with Database Explorer. When I try to connect to Northwind, I get this error message Unable to open the physical file "C:\SQL Server 2000 Sample Databases\NORTHWIND.MDF". Operating System error 5: "5(Access is denied.)" An attemp to ...
Hi, I am considering prototyping a system that would require remoting lambda expressions across remoting boundaries. It would be extremely useful if Expression<T> exposed the capability to "bind" itself to its surrounding environment and get the intermediate tree. Example: ...
So now that we've got lambdas, is there any chance we can get some help from the compiler with currying too? :) It can be done at runtime (see code sample), but it doesn't seem terribly efficient, and it still requires writing out embedded Func<Func<...>, Func<...>> ...
hi, i've got a basic Web Application Project set up in Beta 1. it looks like they did a great job on getting the VS2003 model properly implemented. i'm very impressed with the stability so far. however i'm having trouble with namespaces, i can't reference classes from aspx code behind.i ...
Why are there no assignments of properties allowed in expression trees? It is really a method call to the set method of the property so it seems as if it should be allowed.? Code Snippet class Program{ static void Main(string [] args) { Expression<Action<P>> a = p => p.Number = ...
1930 byte By
Tunga at 2008-2-10
Hi, I have just tried to update a lambda expression in runtime... but I found no way...Is there a way to do it? I mean building a lambda expr.. from a string captured at runtime... Here is my trial, it only works if lambda exp can be evaluated at compile time:static ...
Hi, 1. I need to run a WPF/E application from Apache server. Any Steps? 2. What are the restrictions on using WPF/E 3. I need to develop a Graphical Interface using WPF/E which should be controlled by the values i get from from SQL SERVER DB. How should I proceed for the same? How to add c# ...
Hello all, I was experimenting with object initializers in the orcas beta and found, to my surprise, that the following code compiles:public class Car { public int Id { get; private set; } } class Program{ static void Main(string [] args ) { Car c1 = new Car() { Id = 1 }; // works to my ...
Orcas Beta 1 Professional Compile Fails on Vista I am having the same problem that is mentioned in this thread but that thread is for Vista RC2 and not the RTM. I can't compile any Orcas Beta 1 programs on Vista because I also get: Required file 'alink.dll with IAlink3' ...
We can use Func<> in order to use a delegate. But how using Func to replace a delegate that returns void?
6972 byte By
Jethro at 2008-2-7
// Strongly Request: Improve generic constraint in C#3.0 /**********************************************************************************************************************************/ /* Now, in order to write a GenericType that support simple Arithmetics like "+ - * /" have to ...
Have January 2007 CTP of Orcas. I click File -> New Project... Select Class Library Click OK Right-click project in Solution Explorer (ClassLibraryX) Select Add -> New Item... Select Dataset Click OK The following warning appears in the Error List: Warning 1 The custom tool ...
6972 byte By
Jethro at 2008-2-7
// Strongly Request: Improve generic constraint in C#3.0 /**********************************************************************************************************************************/ /* Now, in order to write a GenericType that support simple Arithmetics like "+ - * /" have to ...
Anybody have or know of an example on how to use these? No docs and the functions are not exactly intuitive.
Hi, I apologize if this is not the right place to post this question. If you know of a more appropriate forum, let me know.I need to create a build of our product for .NET 3.0. Currently we compile it as a "Class Library" project in VS2005 and get an assembly. The assembly is deployed ...
Hi everyone,I have some trouble using the VS2k5 extensions : I have no "Class Library" template (I mean no .NET 3-specific template), and the old .NET 2 template won't work : when I try to add, for example "using System.Windows.Media", the assembly is just not found.Any ...
So now that we've got lambdas, is there any chance we can get some help from the compiler with currying too? :) It can be done at runtime (see code sample), but it doesn't seem terribly efficient, and it still requires writing out embedded Func<Func<...>, Func<...>> ...
I downloaded the Visual Studio Orcas March 2007 CTP but when I double click the VSCTPBase file to install it on Windows Vista, I get an error "The parameter is incorrect" Any ideas?
Hi...I have the Visual Studio Orcas March CTP (9.0.20209) and running on Windows Vista RC1.I have a class A which contains a protected field called "operators". Then I have a class called B and a class called C. Both classes uses the "operators" field, but class C could not ...
So when is the APRIL CTP of Orcas going to be released? Any time soon? I hope it works on Vista !!!
Hi! Is it possible to use automatic properties within structs? I tried and compilation was right until I tried to initialize values in constructor. Am I forced to use Object Initializers as workaround? Thanks
What happened to the ORCAS DEC CTP? There was a post about it yesterday and now its gone?
Have January 2007 CTP of Orcas.I click File -> New Project...Select Class LibraryClick OKRight-click project in Solution Explorer (ClassLibraryX)Select Add -> New Item...Select DatasetClick OKThe following warning appears in the Error List:Warning 1 The custom tool 'MSDataSetGenerator' ...
I have two applications that uses MSMQ for duplex communication, host and client.The host has an in-queue (Q1) where the client sends messages to the host. When a client sends a "register"-message, a new queue (Q2) is created by the host, where the client can receive answers from the ...
When I open the project's properties. Each tab in the properties window displayes a red X and Microsoft.VisualStudio.Shell.WindowPane.OnCreate(). So far I have tried this using a C# web and a C# windows project.I am using the installable bits on XP SP2. I chose the default install option and ...