.net-4.0

RegAsm dll .net2.0 to .net4.0

﹥>﹥吖頭↗ 提交于 2019-12-11 08:19:09
问题 I have a dll that registers fine using .Net2.0's regasm, but when attempting to register with a .NET4.0 regasm, I get the error "Could not load file or assembly ' FILENAMEHERE ' or one of it's dependencies. Operation is not supported. (Exception from HRESULT: 0x8013515 Code and assembly are below STARTelnet.cs /** *Steven T. Norris Created: 3/27/2012 *Last Updated By: Steven T. Norris Last Updated On: 3/27/2012 * */ using System; using MinimalisticTelnet; using System.Net.Sockets; /** *

Enum type not being mapped to DB table

别来无恙 提交于 2019-12-11 08:14:27
问题 I'm using EF 5.0 Code First, in a .NET 4 library. Trying to set a class member to be of an Enum type, but it doesn't get persisted to the database, and no runtime exception occurs when EF is creating the database based on the code. Of course, when I try to query against that Enum: var departments = db.Departments .Where(dep => dep.Name == DepartmentNames.English); I get an exception saying: The specified type member 'Name' is not supported in LINQ to Entities. Only initializers, entity

Unity Decorator Extension fails with multiple implementations

萝らか妹 提交于 2019-12-11 08:10:07
问题 I've been struggling with this problem for a couple days, and I still am not sure how to solve it. I've created a container extension for the Unity Container to enable me to easily register decorator classes in the container. This is the implementation I currently have, which is almost identical to the one in this article: public class DecoratorExtension : UnityContainerExtension { private int m_order; private Dictionary<Type, IList<DecoratorRegistration>> m_typeStacks; protected override

Reading a delimted file using LINQ

ⅰ亾dé卋堺 提交于 2019-12-11 08:04:52
问题 The following LINQ reads a delimited file. Currently, it outputs only the recordId. I want it to output all the fields in file so I can perform some additional LINQ operations on the data. For example, I want to group by recordId, sort by a date, and take(x) results. I want all the fields in the csv to be returned. Do I need to decalre a variable and set use the index value, like I did for FirstName, LastName and recordId? Not a big deal but is there a better way? I tried removing the return

bookmarking inside a transaction WF4.0

雨燕双飞 提交于 2019-12-11 07:54:45
问题 I am creating long running workflow with will create a Bookmark for the persistance. When I execute the workflow it is workflow is working like a charm. Issue is here when I enclose the entire workflow in transaction scope, it is not completing its execution once it hits .waitone() I don't see the execution. For sure we need the transaction to be present out the workflow. I checked the DTC setting on the DB its ON. I think issue is with bookmarking in WF 4.0 and transaction on top of it. 回答1:

generic list of objects contains short returning false

让人想犯罪 __ 提交于 2019-12-11 07:50:11
问题 I am working on a project and i have to check for some values of type short in a generic list of object. Strangely I noticed that it is always returning false even if there is that value in the generic list of objects. I am providing a small piece of code which replicates that scenario in my project. List<object> objectList = new List<object>(); objectList.Add(1); objectList.Add(2); objectList.Add(3); if (objectList.Contains(1)) { short i = 1; if (objectList.Contains(i)) { } else if

Is General Exception handling not so bad in this case? [closed]

限于喜欢 提交于 2019-12-11 07:47:03
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 months ago . In the code below I try to send a set of notifications and I want to know if a notification was sent successfully (to put it in a database later so never send it again). Is it bad I'm catching Exception here? I really don't care about the reason a notification wasn't sent.

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

Upload large files on webpage?

*爱你&永不变心* 提交于 2019-12-11 07:42:26
问题 We use the MojoPortal to a website and have some problems to upload files that is around 100 MB with the upload module. (Pleas note that this has probably nothing to do with MojoPortal but with the ASP.NET and the IIS) The MojoPortal is set to use regular file Upload(not Neat Uploader) and to be able to upload big files we have set the following : <httpRuntime maxRequestLength="2097151" executionTimeout="18000" requestValidationMode="2.0"/> And : <compilation debug="false" defaultLanguage="C#

Shuffle string array without duplicates

萝らか妹 提交于 2019-12-11 07:39:30
问题 I am using the Knuth-Fisher-Yates algorithm to display a shuffled array of string items on a windows form. I do not get any duplicates, which is what I was trying to achieve, however, it only spits out 12 of the 13 elements of the array. How can I get it to display all 13 elements of the array? Here is my code: private void FormBlue1_Load(object sender, EventArgs e) { // set the forms borderstyle this.FormBorderStyle = FormBorderStyle.Fixed3D; // create array of stationOneParts to display on