I have a C# program that is using the standard ApplicationSettingsBase to save its user settings. This was working fine under .NET 3.5. And the provided Upgrade() method would properly "reload" those settings whenever a new version of my program was created.
Recently, I recompiled the program with .NET 4.0. My program's version number...
I was using the strlen function from msvcrt.dll in a .Net 3.5 project. More specifically:
private unsafe static extern int strlen( byte *pByte );
After migrating to .NET 4.0, if I use this function it throws a PInvokeStackImbalance exception.
How can I import the .NET 3.5 msvcrt.dll or fix this exception?
...
Once the singleton pattern is understood, writing subsequent singleton classes in C# is a brainless exercise. I would hope that the framework would help you by providing an interface or a base class to do that. Here is how I envision it:
public sealed class Schablone : ISingleton<Schablone>
{
// Stuff forced by the interface goes he...
I have some entities created with LINQ-to-SQL. Six of these entities (representing values primarily in drop-down lists) implement an interface I've called IValue. I did this because the UI layer is going to have to account for a couple special cases -- notably, what to display if the original value on a record has been flagged as deleted...
OK. I was going a little crazy today with a WPF project. I'm using VS2010 with .NET 4.0 and I added a simple reference to another project in my solution, added a member variable of one of the referenced types and tried to compile. Nothing. Well, something. It did not recognize the type at all.
I verified at the namespace using st...
I am trying to detect when an item is checked, and which item is checked in a ListBox using Silverlight 4 and the Prism framework. I found this example on creating behaviors, and tried to follow it but nothing is happening in the debugger. I have three questions:
Why isn't my command executing?
How do I determine which item was check...
Today I experienced a weird problem while trying to remotely debug an application built for the .NET 4.0 runtime.
The application resides on a network share and executed by a remote machine. However the application crashes each time during load because of a SecurityException raised by a permission demand in the System.Configuration.Conf...
Hello all.
Am I going mad/blind? Probably a combination of the two.
How does one go about removing the data labels from a pie chart with the new chart control in .net 4?
I can get these to display as tooltips absolutely fine, but ultiamtely I'd like the labels not to be present as it looks rather busy.
I've searched previous answers ...
Forgive me for being a little naive perhaps, but it seems that System.Windows.Controls.DataVisualization.Charting has vanished from VS2010, and blend 4. I'm trying to make a bar graph with a line overlayed, but can't even get started because I can't find the appropriate controls.
I know I could use an external graphing package, but I'd...
Whenever I attempt to set the default value of an optional parameter to something in a resource file, I get a compile-time error of Default parameter value for 'message' must be a compile-time constant. Is there any way that I can change how the resource files work to make this possible?
public void ValidationError(string fieldName,...
Anybody manage to get .net 4.0 applications compiling on a CI server without installing visual studio 2010 on a CI server. No SDK exists for .net 4.0. Have installed .NET 4.0
on CI Server. Msbuild.exe works for simple projects and give the following warning
(GetReferenceAssemblyPaths target) ->
C:\Windows\Microsoft.NET\Framework\v4....
Is is possible to log when a session times out when a stateserver is used to manage session data?
...
Overview: I'm interested in learning more about the .NET4 "In-Process Side-by-Side Execution" of assemblies, and need additional information to help me demystify it.
Motivation: The application in question is built against .NET2, and uses two third-party libraries that also work against .NET2. The application is deployed (via file copy...
I've currently got a ASP.NET MVC 2 application on .NET 3.5 and I want to migrate it over to the new .NET 4.0 with Visual Studio 2010.
Reason being that it's always good to stay on top of these things - plus I really like the new automatic encoding with <%: %> and clean web.config :-)
So, does anyone have any experience they could share...
I have an application that started life as an MVC (1.0) app in Visual Studio 2008 Sp1 with a bunch of Silverlight 3 projects as part of the site. Nothing fancy at all. Using Ninject for dependency injection (first version 2 beta, now the released version 2 with the MVC extensions).
With the release of .Net 4.0, VS2010, MVC2 etc., we dec...
I am trying to unit test / verify that a method is being called on a dependency, by the system under test (SUT).
The depenedency is IFoo.
The dependent class is IBar.
IBar is implemented as Bar.
Bar will call Start() on IFoo in a new (System.Threading.Tasks.)Task, when Start() is called on Bar instance.
Unit Test (Moq):
[Test]
...
I have just changed my WPF application from .Net3.5 to .Net4. Doing this caused all my global styles to stop working. Only the styles explicitly set using a key did work. I've done some research and figured out what causes this, and reproduced it in a simple app.
I have a simple WPF app containing only a button with text - no style or ...
I cannot log in using any of the membership accounts using .net 4.0 version of the app. It fails like it's the wrong password, and FailedPasswordAttemptCount is incremented in my_aspnet_membership table.
(I am using membership with mysql membership provider.)
I can create new users. They appear in the database. But I cannot log in using...
I know Visual Studio 2010 has a new Code Analysis tool built in, but that is only for the premium and ultimate editions. From what I can see the latest FxCop supports .NET 3.5 SP1. Searching I wasn't able to find any references to an FxCop for .NET 4.0. Is there plans to continue to offer FxCop and for it to support .NET 4.0? Where w...
Here's the scenario i am faced with:
public abstract class Record { }
public abstract class TableRecord : Record { }
public abstract class LookupTableRecord : TableRecord { }
public sealed class UserRecord : LookupTableRecord { }
public interface IDataAccessLayer<TRecord>
where TRecord : Record { }
public interface ITable...