.net-3.5

Any reason why NGEN should hang and never complete for a particular assembly?

旧街凉风 提交于 2020-01-04 14:12:32
问题 I have a class library project for .NET 3.5 built with Visual Studio 2008. If I try to NGEN the core assembly in this solution file, NGEN never completes, or at least not in the time I've bothered to let it run (like overnight). Has anyone else experienced this? And if so, did you solve it? And if you did, how? What steps did you take? If this is a bug in NGEN, how do I post this to Microsoft? I have a connect account, but where do I post a bug-report for this particular product, instead of a

Slow SelectSingleNode

a 夏天 提交于 2020-01-04 12:32:47
问题 I have a simple structured XML file like this: <ttest ID="ttest00001", NickName="map00001"/> <ttest ID="ttest00002", NickName="map00002"/> <ttest ID="ttest00003", NickName="map00003"/> <ttest ID="ttest00004", NickName="map00004"/> ..... This xml file can be around 2.5MB. In my source code I will have a loop to get nicknames In each loop, I have something like this: nickNameLoopNum = MyXmlDoc.SelectSingleNode("//ttest[@ID=' + testloopNum + "']").Attributes["NickName"].Value This single line

ExpressionTree rewrite - MakeMemberAccess() for Navigation Properties

两盒软妹~` 提交于 2020-01-04 06:39:51
问题 Related vaguely to a previous question Note : I'm using a derivative of the ExpressionTree visitor as explained here In my VisitMemberAccess method I currently create MemberExpressions using something along the lines of: // `mapping` is a class used to map EntityA's members to EntityB's members return Expression.MakeMemberAccess(Visit(m.Expression), mapping.TargetMemberInfo); For the most part, this works. Given some test classes... public class EntityA { public long Id { get; set; } public

Managing multiple .Net-Frameworks on a webserver

孤者浪人 提交于 2020-01-04 05:31:25
问题 So I'm in charge to deploy my project on the productive server where some other ASP.NET-Websites are also set up. The problem now is that I wrote my whole project under .NET 3.5 but on the webserver the current installation is .NET 1.1 as some of the other projects require them (don't ask me why, I can't figure it out either but my PM says so...) and thus I'm not allowed installing 3.5 for now but I'm not at all in the mood of rewriting my project on 1.1. Now; is it possible (and if yes, how)

Generating a list of child classes with reflection in .NET 3.5

限于喜欢 提交于 2020-01-04 04:31:09
问题 At runtime, I would like to specify a parent class, and then the program would generate a list of all children classes (of however many generations). For example, if I had Entity as a parent, and Item:Entity and Actor:Entity , there would be two strings, "Actor" and "Item". I see that System.Reflection.TypeInfo is exactly what I am looking for. However, it appears this is exclusive to .NET 4.5, and my environment is unfortunately stuck at 3.5. Is there an alternative way to do this in .NET 3

Download Entity framework for .NET 3.5

你说的曾经没有我的故事 提交于 2020-01-04 04:30:32
问题 Which version of the Entity Framework (EF) I could use in .NET 3.5 and where I could download this older version? 回答1: For .Net 3.5 you can use EF v1. Did you try to download Microsoft .NET Framework 3.5 Service Pack 1 from http://www.microsoft.com/download/en/details.aspx?id=22 It should include The first version of Entity Framework (EFv1) as stated on http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework. 来源: https://stackoverflow.com/questions/10330682/download-entity-framework-for-net-3-5

Save attribute value of xml element with single quotes using linq to xml

二次信任 提交于 2020-01-04 03:55:30
问题 How do I make the XDocument object save an attribute value of a element with single quotes? 回答1: If it is absolutely necessary to have single quotes you could write your XML document to a string and then use a string replace to change from single to double quotes. 回答2: I'm not sure that any of the formatting options for LINQ to XML allow you to specify that. Why do you need to? It's a pretty poor kind of XML handler which is going to care about it... 回答3: As long as you use single- and double

QueryString converting %E1 to %ufffd

若如初见. 提交于 2020-01-04 02:56:06
问题 I have a URL like the following http://mysite.com/default.aspx?q=%E1 Where %E1 is supposed to be á . When I call Request.QueryString from my C# page I receive http://mysite.com/default.aspx?q=%ufffd It does this for any accented character. %E1, %E3, %E9, %ED etc. all get passed as %ufffd . Normal encoded values ( %2D , %2E , %27 ) all get passed correctly. The config file already has the responseEncoding / requestEncoding in the globalization section set to UTF-8. How could I read the correct

Tell LINQ Distinct which item to return

落花浮王杯 提交于 2020-01-04 02:34:25
问题 I understand how to do a Distinct() on a IEnumerable and that I have to create an IEqualityComparer for more advanced stuff however is there a way in which you can tell which duplicated item to return? For example say you have a List<T> List<MyClass> test = new List<MyClass>(); test.Add(new MyClass {ID = 1, InnerID = 4}); test.Add(new MyClass {ID = 2, InnerID = 4}); test.Add(new MyClass {ID = 3, InnerID = 14}); test.Add(new MyClass {ID = 4, InnerID = 14}); You then do: var distinctItems =

in C#, Is there anyway to determine a class's members at runtime?

孤街醉人 提交于 2020-01-03 20:05:13
问题 Suppose I have a class named foo, and it has 3 public members foo1, foo2, and foo3. Now suppose I'm writing a function that takes an instance of class foo as a parameter, but when I'm writing this function I have no idea what public members it has. Is there a way for me to determine at run-time that it has public members foo1, foo2, foo3 AND ONLY foo1, foo2, foo3. IE - find out what all the public members are? And can I also determine their types? 回答1: Well, that's what Reflection is there