.net-4.0

MageUI.exe removes compatibleFrameworks element

走远了吗. 提交于 2019-12-11 03:09:32
问题 We use MageUI.exe to manually create different versions of our ClickOnce deployment for development, test and production. We change the Publisher in order to have the program icon appear in a separate folder of the Start Menu. We use the MageUI.exe version in the Microsoft Windows SDK for Windows 7 and .NET Framework 4 (AKA Microsoft Windows SDK 7.1). This version shows 4.0.30319.1 as its version number. Our .application -files contain a <compatibleFrameworks> element, which is needed for

Reference 3.5 assembly from 4.0 winforms phail

孤街醉人 提交于 2019-12-11 02:43:31
问题 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 library and use the code in it intellisense barks at me saying that it can't find the objects in that library. The thing is I would switch the winforms app to 3.5

Creating a genericly typed Action<> at runtime

我只是一个虾纸丫 提交于 2019-12-11 02:37:54
问题 Is it possible to create a generically typed Action at run time based on some specified types? In this particular scenario, the body of the Action will ultimately ignore the argument types, as the typed Action<> will just be a wrapper around a no-argument Action, e.g. Action original = () => { }; ... Action<TType> wrapper = (arg) => { original(); } Or, even: Action<TTypeA, TTypeB> wrapper = (arg) => { original(); } As you can see, the body of the typed Action<> ignores the arguments, and

WCF .Net 4.0 is treating WebProtocolException as an unhandled exception

≯℡__Kan透↙ 提交于 2019-12-11 02:20:37
问题 Im trying to build an API using WCF and .Net 4, however when I throw the WebProtocolException, it is not displaying a nice error message like it should, instead it is treating it like an unhandled exception. I am using the WebServiceHost2Factory. Has anyone else used WebProtocolException with .net 4? An example of my call is below throw new WebProtocolException(System.Net.HttpStatusCode.BadRequest, "The DateFrom parameter is invalid", new Error() { Code = 6002, Message = "Please ensure your

Why does variance in .NET 4 only support reference types?

寵の児 提交于 2019-12-11 02:10:01
问题 .NET 4 supports co- and contravariance. However, only reference types are supported, not value types. Why is that? 回答1: Basically the CLR needs to know that it can treat a value of the "source" type as a value of the "target" type without performing any extra conversions - to put it simply, the bit pattern for the source value has to be valid as the target value. The representations have to be the same. Otherwise the CLR would need to have extra information to perform the right conversions at

What's the difference between these two StructureMap configs?

坚强是说给别人听的谎言 提交于 2019-12-11 02:00:42
问题 We're struggling with understanding the difference between these two ways to configure StructureMap. Our understanding is that they should be identical but we get different results between these two lines inside of Initialize: ObjectFactory.Initialize(x => { x.For<IBusinessRelationsContext>().Use<BusinessRelationsContext>().Ctor<string>().Is(ConfigurationManager.ConnectionStrings["BusinessRelationsContext"].ConnectionString); x.For<IBusinessRelationsContext>().Use(_ => new

.Net Framework 4.0 SDK

拈花ヽ惹草 提交于 2019-12-11 01:53:49
问题 Does anyone know if there is an SDK for the .Net 4.0 framework, and if there is one, where does the installer put it on the hard drive? I've installed the Ultimate Edition of Visual Studio 2010, but can't find the SDK anywhere. 回答1: The last stand-alone version of the .NET SDK was 2.0. It got integrated with the Windows SDK after that. You already have the important bits on your machine, it is stored in c:\program files\microsoft sdks\windodws\v7.0a It is a truncated version (thus the "a"),

How can I find and remove CSS references in HTML head?

夙愿已清 提交于 2019-12-11 01:23:52
问题 I have created a service to join, minify and compress css-references on a CMS system. Example: Before : <link href="/Files/css1.css" rel="stylesheet" type="text/css"/> <link href="/Files/css2.css" rel="stylesheet" type="text/css"/> <link href="/Files/css3.css" rel="stylesheet" type="text/css" media="all"/> Now you can write: <link href="/min.ashx?files=/Files/css1.css,/Files/css2.css,/Files/css3.css" rel="stylesheet" type="text/css" /> My next task is to take all references in head section

Sending instructions to a thread which is waiting for TCP?

耗尽温柔 提交于 2019-12-11 01:02:22
问题 I'm trying to understand multi-threading in TCP so I'm coding a basic telnet text "router". using ReadLine() each thread using a TCP listener will wait for input from the telnet client and then respond based on the text which is sent. I have this working with multiple threads and multiple telnet clients. I want to conditionally send messages to all threads. For example, if the text sent from any one thread is "Alert!" then I want every thread for connected clients to execute WriteLine("Alert!

Saving an item in the drafts folder also creates a blank outbox item

岁酱吖の 提交于 2019-12-11 01:00:58
问题 I have a C# console app that dynamically creates a bunch of emails and saves them to the Drafts folder in Outlook 2013. However, I've run into an issue where the items I create are not only created in the Drafts folder, but a blank item is also created in the Outbox folder (one blank Outbox item is created for every filled in Drafts item). For comparison, when I try to create a draft email using the UI, it works as intended. I create a new email, click Save, and the item only appears in the