.net-4.0

App.Config errors with “Configuration system failed to initialize”

隐身守侯 提交于 2019-12-09 16:15:46
问题 I have a console application written in C# under .net 4.0 It has a bunch of variables which I want to move into App.Config (so it will be all in one place). Added this part of code to App.Config (between configuration tags): <configuration> <appSettings> <add key="RemoteDirectory" value="Some Text Here"/> </appSettings> </configuration> In my program trying to test it with this code Console.WriteLine(ConfigurationManager.AppSettings["RemoteDirectory"]); but I keep getting "Configuration

Is Parallel.ForEach in ConcurrentBag<T> thread safe

青春壹個敷衍的年華 提交于 2019-12-09 15:54:06
问题 Description of ConcurrentBag on MSDN is not clear: Bags are useful for storing objects when ordering doesn't matter, and unlike sets, bags support duplicates. ConcurrentBag is a thread-safe bag implementation, optimized for scenarios where the same thread will be both producing and consuming data stored in the bag. My question is it thread safe and if this is a good practice to use ConcurrentBag in Parallel.ForEach. For Instance: private List<XYZ> MyMethod(List<MyData> myData) { var data =

Doesn't .NET 4.0 contain .NET 2.0?

心已入冬 提交于 2019-12-09 14:47:40
问题 I've encountered a strange problem. I've installed "Visual Studio 2010 ultimate". While installing it showed that it sucessfully installed .NET 4.0. While installing some other softwares. They complain that .NET 2.0 is missing and asking me to install it. How is it possible? .NET 4.0 must include .NET 2.0 right? EDIT: Now, I'm confused. According to this http://en.wikipedia.org/wiki/File:DotNet.svg CLR is part of .NET 2.0. Installing .NET framework 4.0 implies installing the entire stack.

Visual Studio 2012 Test Project Mixed Mode Runtime

旧时模样 提交于 2019-12-09 14:20:21
问题 I'm currently working in the Visual Studio 2012 RC with a test project. I have included the following assemblies: Microsoft.SqlServer.Smo Microsoft.SqlServer.SmoExtend Microsoft.SqlServer.ConnectionInfo Microsoft.SqlServer.Management.Sdk.Sfc These assemblies are build in version 2.0.50727 and I have a test project in .NET 4.0. So based on this information I have added an app.config file into the project with the following lines: <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup

Linq context object isn't registering as a type of System.IDisposable object

旧城冷巷雨未停 提交于 2019-12-09 14:10:54
问题 I'm trying to use my 'context' object in a using statement. It works on one project, but on another, I'm getting the following error. '...': type used in a using statement must be implicitly convertible to 'System.IDisposable' When I'm referring to the 'context' object, I'm referring to the object automatically created when you're working with LINQ to SQL. The class I'm working within, implements another interface, could that be screwing up this context object? using (TGDC context = new TGDC(

JSON - is there any XML CDATA equivalent?

↘锁芯ラ 提交于 2019-12-09 14:00:34
问题 I'm looking for a way that json parsing will take information as is (as if it was CDATA) - and not to try to serialize that. We use both .net and java (client and server) - so the answer should be about JSON structure Is there any way to achieve this structure? Thanks. 回答1: There is no XML CDATA equivalent in JSON. But you can encode your message in a string literal using something like base64. See this question for more details. 回答2: http://www.json.org/ describes JSON format in details.

WebBrowser Control and Adobe Flash content

纵然是瞬间 提交于 2019-12-09 13:46:19
问题 I have a standard WebBrowser Control that has been modified to use IE11 in Edge Mode (see here for details for how I did that). I am unable to play Flash content on some websites, a notable one being BBC iPlayer and other media requiring Flash served on the BBC website, for which I receive the following error: There was a problem initialising the player. Script access is denied in your browser. I am able to view this content using Internet Explorer, and script access is enabled within IE.

How can I add a VS 2010 .Net 4.0 build agent to TFS 2008

穿精又带淫゛_ 提交于 2019-12-09 13:07:42
问题 My company has two development teams using TFS 2008. My team would like to migrate our .Net 3.5 app to the .Net 4.0 framework, but the company is not ready to upgrade TFS to TFS 2010. Can we still use TFS 2008's team build system but with a Visual Studio 2010 solution/project structure that targets the .Net 4.0 framework? I am thinking we would need to add a new build agent to TFS 2008 that would have VS 2010 installed. But I am not finding any information on how to do this. Is this possible?

Error in “web.config” file when i load page in online

时光总嘲笑我的痴心妄想 提交于 2019-12-09 13:01:41
问题 I am fresher developer in ASP.NET(4.0). I develop one website and it completely work in my local system. But now i upload all files in server and when i load any pages error is occur in Web.config file. My Web.Config Code is.... <?xml version="1.0" ?> <configuration> <connectionStrings> </connectionStrings> <system.web> <compilation debug="true" targetFramework="4.0"/> <customErrors mode="Off"/> <authentication mode="None"/> </system.web> </configuration> AND ERROR IS (when i run at server)..

.NET Ionic.Zip : Compressed or Uncompressed size, or offset exceeds the maximum value

北战南征 提交于 2019-12-09 09:32:20
问题 I have the following set up: Win2008 server Ionic.zip reference module A seperate drive for building the zip files .NET 4.0 The web app builds zip packages, on the fly, and allows the client to download the package. This system has worked wonderfully... until now. Recently we added some larger files (2GB to 11GB) that all need to be wrapped up in a package before downloading to the client. Originally I had this system set up to happen all on the C: (a mistake). Right away, especially with the