.net-4.5

Range slider metro style app

北城余情 提交于 2019-12-11 08:53:39
问题 I'm trying to make a range slider for metro style app, because it's not available. I'm trying to leverage an existing silverlight range slider, but it's not going to well. I changed the code a bit, but now it just shows the slider and I can't move the thumbs. Here is the xaml code: <UserControl x:Class="Mecoms_Mobile_App.RangeSlider" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Grid x:Name="LayoutRoot" Background=

Repository Pattern with Entity Framework and MVC4 Building Dynamic Connection String

筅森魡賤 提交于 2019-12-11 08:23:20
问题 I am facing an issue while implementing the Repository Pattern [UoW] for MVC4 with EF6. Error: 'XX.DataAccess.Context' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'TContext' in the generic type or method 'XX.DataAccess.WriteRepository' //Data Access layer Class for Saving/Deleting/Retriving etc. Inherits WriteRepository public class Common : WriteRepository<Context>, ICommon { //Method } //Repository Pattern public abstract class

Is it possible to reference an assembly that targets .net 4.5 in a project that targets 4.0?

寵の児 提交于 2019-12-11 07:46:58
问题 I have a MVC 3 application that targets .net 4.0 It has a dozen or so projects also targeting .net 4.0 I have created a new project for the solution targeting .net 4.5 that uses reflection (there are a couple of nice bits of functionality in 4.5 that I want to use). When I try to compile I get an error saying that the 'type or namespace (new 4.5 proj) could not be found, are you missing a directive or an assembly reference'. Is it possible to have a reference to an assembly targeting .net 4.5

MEF open generic problems with 4.5

帅比萌擦擦* 提交于 2019-12-11 07:36:02
问题 We were using MEF Contrib open generics support like this: [InheritedExport] interface ITest2<T> { void Execute(); } class TestClass2<T> : ITest2<T> { public void Execute() { Console.WriteLine(); } } class Program { static void Main(string[] args) { var catalog = new AssemblyCatalog(typeof(Program).Assembly); var container = new CompositionContainer(catalog); var test2 = container.GetExportedValues<ITest2<string>>(); } } However, since the installation of .NET Framework 4.5, this code no

How to load/import dll with MEF out of metro app?

三世轮回 提交于 2019-12-11 07:28:35
问题 I've trying to write a extendable metro app using MEF. I got it working with a local extension (inside of the current assembly). Now I want to load a external dll. The DirectoryCatalog seems to be not present in .net 4.5. So I tried to use ApplicationCatalog but I got the following error while calling SatisfyImportsOnce : Assembly.LoadFrom is not supported in AppX. . Here's me code: var catalog = new AssemblyCatalog(GetType().GetTypeInfo().Assembly); ApplicationCatalog catApp = new

DataGridView Default Error on ComboBox Column

偶尔善良 提交于 2019-12-11 07:25:26
问题 I have a DataGridView in my .NET 4.5 WinForms app with two columns. One column is a regular textbox column and the other column is a DataGridViewComboBoxColumn that is a dropdown. I am trying to bind the columns to a BindingList of my Filter object and I would like everything inside of the enum FilterType to show up in the dropdown. Here's the code for my object and enum: public class Filter { public string keyword { get; set; } public FilterType type { get; set; } } public enum FilterType :

Odd XAML Error: '“System.Windows.StaticResourceExtension” cannot be applied'

送分小仙女□ 提交于 2019-12-11 06:41:41
问题 I have the following XAML to provide a recent document menu like VS2012's FILE > Recent Documents menu <MenuItem Header="_FILE"> ... <MenuItem Header="_Recent Studies" ItemsSource="{Binding RecentFiles}" AlternationCount="{Binding RecentFiles.Count}" HeaderTemplate="{x:Null}"> <MenuItem.Resources> <Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}"> <Setter Property="HeaderTemplate" > <Setter.Value> <DataTemplate> <TextBlock> <TextBlock.Text> <MultiBinding

How do you create and consume OWIN JWT?

泄露秘密 提交于 2019-12-11 05:15:43
问题 I have a WebAPI, and I need to secure an Angular 4.x app so I though I could use JWT. I'm trying to figure out what's the bare minimum (no OAuth?) to achieve it using Microsoft's OWIN Katana 3.x packages. How can it be done? 回答1: The following doesn't work (Microsoft's/System parts entangled in a breaking way). But it's the closest I could get to something looking almost simple. using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using System.Security.Cryptography; using

Server side HTML table with tbody not compiling in ASP.NET 4.5 [duplicate]

帅比萌擦擦* 提交于 2019-12-11 04:39:40
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to create thead and tbody in ASP.NET Table? The following HTML does not compile in an ASP.NET Website <table runat="server" id="tbl1"> <tbody> <tr> <td> </td> </tr> </tbody> </table> I get this compilation error: The best overloaded method match for ‘System.Web.UI.HtmlControls.HtmlTableRowCollection.Add(System.Web.UI.HtmlControls.HtmlTableRow)’ has some invalid arguments This error started appearing after I

How to catch exception/fault where message size is larger than accepted by the service (server side)?

大城市里の小女人 提交于 2019-12-11 04:18:51
问题 At first, I thought if I added an implementation of IDispatchMessageInspector, that perhaps this would intercept the message size before any checking on the limit is done. I soon found, this is not the case. The running service obviously makes sure to enforce this rule on a lower level. Now I am curious if there is a way in which I can capture such an exception on the server level and return a response to the client. Would the an implementation of IErrorHandler as a ServiceBehavior do the