.net-3.5

IN VS2008, for C#, How can I figure out which references are needed and which are not?

IN VS2008, for C#, How can I figure out which references are needed and which are not? If you look in the solution explorer for a certain project and expand the references folder, is there a way to tell those that are never called? Will this be determined at compile time and simply not included? ...

"Cannot use fixed local inside lambda expression"

I have an XNA 3.0 project that compiled just fine in VS2008, but that gives compile errors in VS2010 (with XNA 4.0 CTP). The error: Cannot use fixed local 'depthPtr' inside an anonymous method, lambda expression, or query expression depthPtr is a fixed float* into an array, that is used inside a Parallel.For lambda expression from ...

Can I use C# 4.0 in VS2008 / ASP.NET 3.5 application ?

Can I certainly do this ? If this is possible how do we do this ? What language features of C# 4.0 are tightly bound to the CLR of .net 4.0 framework if any? In case if no features are bound to CLR4.0 can we really use C#4.0 in a .Net3.5 application ? ...

How to check if client script is already registered during a partial postback

Below is the code I've currently implemented. if (!Page.ClientScript.IsStartupScriptRegistered(Page.GetType(), scriptKey)) { ScriptManager scriptManager = ScriptManager.GetCurrent(page); if (scriptManager != null && scriptManager.IsInAsyncPostBack) { //if a MS AJAX request, use the Scriptmanager class ScriptManager.Registe...

Single Sign on using Shibboleth

Hi, I have to implement Single Sign On in my .NET(3.5) project using Shibboleth. Detailed requirement goes this way: 1) I have developped a web application using .NET (3.5) named "abc.com". 2) There are some third party applications which will be launched from "abc.com" 3) If I have logged in to "abc.com" and now if I launch any of the...

Visual Studio 2008 - Is it possible for two projects to share common classes?

In Visual Studio 2008 I know its possible to have one solution with two (or more) projects. Is it possible OR How is it possible for the projects to share common class files? For example -> Project 1 has a log file handling class. Can Project 2 reference it? My hope is to increase code re-use and avoid two copies of the same thing th...

How dynamic can I make my LINQ To SQL Statements?

I have the need to construct a LINQ To SQL statement at runtime based on input from a user and I can't seem to figure out how to dynamically build the WHERE clause. I have no problem with the following: string Filters = "<value>FOO</value>"; Where("FormattedMessage.Contains(@0)",Filters) But what I really need is to make the entire W...

How do I eliminate Error 3002?

Say I have the following table definitions in SQL Server 2008: CREATE TABLE Person (PersonId INT IDENTITY NOT NULL PRIMARY KEY, Name VARCHAR(50) NOT NULL, ManyMoreIrrelevantColumns VARCHAR(MAX) NOT NULL) CREATE TABLE Model (ModelId INT IDENTITY NOT NULL PRIMARY KEY, ModelName VARCHAR(50) NOT NULL, Description VARCHAR(200) NULL) CR...

Expression.Default in .NET 3.5

How can I emulate Expression.Default (new in .NET 4.0) in 3.5? Do I need to manually check the expression type and use different code for reference and value types? This is what I'm currently doing, is there a better way? Expression GetDefaultExpression(Type type) { if (type.IsValueType) return Expression.New(type); re...

Reference 3.5 assembly from 4.0 winforms phail

So I have this utility library that is compiled as a dll under .net 3.5 and it is used by my asp.net 3.5 website. I created a .net 4.0 winforms app to push data onto the website. I want to make use of the functionality in the utilities library from this winforms app. The problem lies in that when I make reference to the utilities libr...

Why always fires OnFailure when return View() to Ajax Form ?

I'm trying to make a log-in log-off with Ajax supported. I made some logic in my controller to sign the user in and then return simple partial containing welcome message and log-Off ActionLink my Action method looks like this : public ActionResult LogOn(LogOnModel model, string returnUrl) { if (ModelState.IsValid) { if ...

C# Math class question

I need to calculate Tanh-1 in C# (and Sinh-1 and Cosh-1) I did not found it in Math library.. Any suggestions ? EDIT: Tanh not Tan !! ...

Do I have to refresh a LINQ object that represents a view/table row after I do a submitchanges operation that may alter it?

Do I have to refresh a LINQ object that represents a view/table row after I do a submitchanges operation that may alter it? Let's say I have Event _event = new Event { someproperty = "this"; }; DataContext.Events.InsertOnSubmit(_event); DataContext.SubmitChanges(); //some operations _event.someproperty = "that"; DataContext.Submit...

Executing a workflow from another workflow ?

Hi all I have a console sequential workflow. At a certain step I use the InvokeWorkflow activity to invoke another workflow. I check a certain value that is set by the second workflow, and continue the execution of the first workflow normally. The problem is when InvokeWorkflow activity is executed the program executes the second wor...

Does anybody know the .NET framework book on 3.5 like professional .NET framework 2.0 by Joe Duffy?

I am still searching for .NET framework book like that of Joe Duffy's Professional .NET framework. That book is excellent source of insights of .NET framework and techniques of languages that has not been covered by any book. I wish duffy write again for 3.5 or 4.0..If you know some book like this one pls pls let me know.. God Bless you...

How to deploy ClickOnce .Net 3.5 application on 3.0 machine

I have .Net 3.5 SP1 WPF application which I'm successfully deploying to client computers using ClickOnce. Now I got new requirement - one of our clients need to run the application on machines equipped just with .Net 3.0 and it's entirely impossible to upgrade or install anything on the machines. I already tried to run the 3.5 applicatio...

Output Path property issue on build server

I am working in the .NET 3.5 framework. I have a project that builds fine locally. I can build it on our build server when the source files are posted there. However when I am running the build process through Visual Studio 2010 I get a warning that says "C:\WINDOWS\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets: The OutputPath ...

Why is caching such an issue in .net 3.5?

Has anyone else having an issue with browser caching when using .net? I am using VS 2008 and IE8. And I include all the recommended code to ensure that there is no caching, still 20% of the time, I get cached values. This was never an issue with classic asp. Any ideas? ...

RW access to shared Windows folder using different user credentials in .NET

We are working in Windows network (AD in use) We have folder shared by user (access limited for this user only) User credentials are known I need to access to that share inside my app. Note I've read about Impersonation but what I can do is open entire application in new user context (but what I need is working as currently logged use...

Is there unreachable code in this snippet? I don't think so, but Resharper is telling me otherwise.

I have the following method I came across in a code review. Inside the loop Resharper is telling me that if (narrativefound == false) is incorrect becuase narrativeFound is always true. I don't think this is the case, because in order to set narrativeFound to true it has to pass the conditional string compare first, so how can it always ...