.net-4.0

Clean Web.Config file in Asp.NET 4.0?

Okay, I am wondering having clear web.config file could be good but you know some shared web hosting companies don't allow us to touch things like machine.config and etc. So If a lot of things have been moved onto machine.config, then will we be allowed to change things like we used to through web.config file. ...

Force MSBuild to hold reference to binaries

How can I force MSBuild to hold reference to binaries even when they're not referenced in code ? ...

WebClient error when using a thread in .NET

I'm having a very weird error using the WebClient class in .NET 4. The app simply downloads some files off the internet and provides output on a textbox (the GUI is WPF). The method that does this is the following: void DownloadFiles(object files) { fileL = (List<string>) files; foreach (string url in fileL) { byte[...

What is wrong with ToLowerInvariant()?

I have the following line of code: var connectionString = configItems.Find(item => item.Name.ToLowerInvariant() == "connectionstring"); VS 2010 Code analysis is telling me the following: Warning 7 CA1308 : Microsoft.Globalization : In method ... replace the call to 'string.ToLowerInvariant()' with String.ToUpperInvariant(). Do...

WPF menu like control showing when clicking a control ;) How?

I have an application that connects to a server. In the status bar I show the connection status, and on a click I want to open a "menu like" subcontrol over the status showing control where more detailed connection information is shown (like: user name, server name, ping delay, disconnect / reconnect button). This should basically look ...

.NET 4.0 Fails When sending emails with attachments larger than 3MB

I recently had an issue after upgrading my .net framework to 4.0 from 3.5: System.Net.Mail.SmtpException: Failure sending mail. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Net.Base64Stream.EncodeBytes(Byte[] buffer, Int32 offset, Int32 count, Boolean dontDeferFinalBytes, Boolean shouldAp...

Could not load type 'System.Web.Mvc.ViewUserControl<SOMETYPE>'.

I'm trying to deploy ASP.NET MVC 2 project (VS2010) to Win Server 2008 R2 It works perfectly on dev machine. But strange error occurs at Server 2008 R2: When .ascx file has header that uses generic type: <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyProj.Web.Models.RangeViewModel>" %> Server reports Could not ...

Does the .Net Framework 4.0 Installer include the .Net Framework 3.5

Do .Net components that were compiled against the .Net Framework 3.5 run on a system that has only .Net Framework 4.0 installed? Or in other words does the .Net Framwork 4.0 Installer include the .Net Framework 3.5? ...

Is it possible to have multiple routes to the same page but with different route parameters?

I have one page "~/Admin/Teams/Edit.aspx". This page has 2 function "Insert/Edit". I have two routes defined: routes.MapPageRoute("teams-new", "team-new/{league}", "~/Admin/Teams/Edit.aspx"); routes.MapPageRoute("teams-edit", "team/{te...

wcf 4 netTcpBinding

I was seting up a wcf 4 service today with netTcpBinding, and I just couldn't get it to work. It was of course no problem getting basdicHttpBinding to work since little config is needed in WCF 4. I started wondering if it is even possible to get netTcpBinding working when debbuging through VS10. I'm hosting my service in a svc-fil...

Use EdmFunctionAttribute without exposing Entity Framework dependency/implementation details?

Is there a good way to leverage EdmFunctionAttribute without introducing a dependency on The Entity Framework/System.Data.Entity.dll? I thought I could have an interface with a method and a concrete implementation that implements the method using EdmFunctionAttribute to map it to a database function. I have a context interface IMyConte...

What's all the hype over objectsets in Entity Framework 4?

I am an intermediate user of EF in .net 3.5 and have recently moved to working with .net 4. One thing i keep coming across when reading various tutorials is the use of ObjectSets instead of ObjectQuerys and that they are a great new feature. What is so great about them? Please enlighten me. Kind regards, Kohan ...

CCNet and .Net 4.0

Could not load file or assembly 'System.Data' or one of its dependencies. An attempt was made to load a program with an incorrect format We have just upgraded one of our projects to .Net 4.0 and have re-configured our build server (Cruise Control .Net). Anyone help with the above error? I have included more trace below. > ...

Accessing webmethod with jquery

I'm currently using jquery ajax to call a pagemethod (which works great); $.ajax({ type: "POST", url: "ArticleList.aspx/GetArticleTags", data: "{'articleId' : " + articleId + "}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { ...

VB.NET, templates, reflection, inheritance, feeling adrift

I've just made myself up a problem and am now wondering how to solve it. To begin with, I'm using some third-party components, including some calendar controls like schedule and timeline. They're used in the project classes more or less like that: Friend Class TimeBasedDataView 'some members End Class Friend Class ScheduleDataView...

.NET 4: Process.Start using credentials returns empty output

I run an external program from ASP.NET: var process = new Process(); var startInfo = process.StartInfo; startInfo.FileName = filePath; startInfo.Arguments = arguments; startInfo.UseShellExecute = false; startInfo.RedirectStandardOutput = true; //startInfo.RedirectStandardError = true; process.Start(); process.WaitForExit(); Console...

How to control CSS class applied to ASP.NET 4 Menu with RenderingMode=List

I am using an ASP.NET 4.0 Menu control with RenderingMode=List and am struggling with creating the appropriate CSS. Each menu item is represented by an <li> tag that contains a nested <a> tag with what appear to be fixed class names: <a class="level1"> for unselected level 1 menu items <a class="level2"> for unselected level 2 menu it...

How do you deploy MVC 2.0 to IIS6 running .Net 4.0??

Hi All, i have an MVC app and i'm trying to deploy it to a 2008 server running IIS6 with .Net 4 installed. The project is built with VS2010. Thanks! ...

How do I read a secure rss feed into a SyndicationFeed without providing credentials?

For whatever reason, IBM uses https (without requiring credentials) for their RSS feeds. I'm trying to consume https://www.ibm.com/developerworks/mydeveloperworks/blogs/roller-ui/rendering/feed/gradybooch/entries/rss?lang=en with a .NET 4 SyndicationFeed. I can open this feed in a browser and it loads just fine. Here's the code: ...

BackwardcCompatibility of .NET Framework 4

We have an WPF Application build on .net framework 3.5. Some testers find if they uninstall .net framework 3.5, but install .net framework 4.0, our APP fails to launch itself. Dose this mean that .net framework 4.0 does not include all 3.5 libs, and users have to install .net 3.5 even though they have 4.0? I see here are some migratio...