Max Toro

1

votes
0

answer
25

views

How to execute code in MSBuild after references are copied

I need to perform code generation before a project builds, so the generated code is included in the build. For that I am using PreBuildEvent. The problem is when I need to use an assembly that is referenced by the project, and in PreBuildEvent it is not copied yet. Is there another event I can use?...
Max Toro
1

votes
1

answer
389

views

sandcastle, how to link to non-framework classes in msdn?

When I create a website with Sandcastle it's not linking other non-framework classes from Microsoft, like ASP.NET MVC or Unity.
Max Toro
1

votes
1

answer
147

views

Visibility of an overriden component

In Binding References to Components there's an example which I find confusing: Then it says: The visibility is changed according to the rules in 3.5.3.2 Accepting Components: in particular, visibility='private' changes to visibility='hidden'. Why do you need to specify private to change the visibili...
Max Toro
1

votes
8

answer
0

views

Is change-tracking in ORMs a necessity or a luxury, in the context of web apps?

Since web applications are mostly stateless, and linear (request comes in, response goes out), is change-tracking really necessary? E.g. if I have an action that updates a Product instance I know at code-time what state I'm changing, I can just tell the repository 'please update this instance'. To c...
Max Toro
1

votes
3

answer
908

views

How does ASP.NET WebPages implement extensionless URLs?

I'd like to implement the same thing for my own build providers. I'm talking about an ASP.NET Webpages application, in Visual Studio: File > New Website > ASP.NET Website (Razor) Works with Cassini, so it's not an IIS Express thing.
Max Toro
1

votes
2

answer
169

views

XSLT key in push transformation, better performance?

I am using in a push transformation, using it in template patterns, e.g.: ... ... instead of: ... However, I don't know if this has any performance benefits, and lately I've been thinking, since this is a push transformation, and the node is visited anyways, is the key really useful ?
Max Toro
1

votes
3

answer
134

views

Does LINQ to SQL or any other LINQ enabled ORM support many association filtering?

Apparently, according to this you cannot query a many relationship without loading the entire collection. In other words, it's a LINQ to Objects instead of a LINQ to Entities query. E.g. Category category = db.Categories.Find(1); var productsThatStartWithA = category.Products.Where(p => p.Name.Start...
Max Toro
1

votes
3

answer
123

views

Does C# 8 annotate nullable properties and parameters?

I'm curious about how nullable reference types work, not in your own codebase, but with an already compiled library. Will C# be able to know if a property or parameter is nullable, perhaps checking the existance of some compiler-added attribute?
Max Toro
19

votes
2

answer
28.7k

views

Forms authentication failed for the request. Reason: The ticket supplied has expired

My event log is flooded with this message: Forms authentication failed for the request. Reason: The ticket supplied has expired. I think this happens when people timeout instead of logout. First of all , this is not an error, it's Type: Information I don't want this information, how do I stop ASP.NE...
Max Toro
1

votes
1

answer
205

views

Dynamic cast in XSLT 2.0 or 3.0

I have this code to cast a string to a type determined at runtime: Is there a better way to do this in XSLT 2.0? how about in 3.0?
Max Toro
2

votes
1

answer
228

views

why use string constructor with char array for constants?

I found this piece of code and I'd like to understand why the developer used the string constructor with a char array instead of just a literal constant string: static string atomLang = new String('lang'.ToCharArray());
Max Toro
2

votes
5

answer
885

views

Configuration vs. static properties, security concerns

I'm developing a class library and I need to provide a way to set configuration parameters. I can create a configuration section or I can expose static properties. My concern about static properties is security. What prevents a malicious component from making changes at runtime? For instance, in ASP...
Max Toro
2

votes
4

answer
995

views

Hyphen in method name, is it possible in any .NET language?

I need to support a method named 'send-request' as an extension function to be used in an XSLT transformation. This is provided by an extension object on XslCompiledTransform. The cool thing about extension objects vs. is, well, that I don't have to use , you just declare the namespace and call the...
Max Toro
3

votes
2

answer
165

views

error keyword in .NET languages

Which .NET languages have error as a keyword? I have a class named Error and FxCop says it's a reserved language keyword.
Max Toro
12

votes
3

answer
580

views

ASP.NET routing: Literal sub-segment between tokens, and route values with a character from the literal sub-segment

The reason I'm asking is because IIS protects certain ASP.NET folders, like Bin, App_Data, App_Code, etc. Even if the URL does not map to an actual file system folder IIS rejects a URL with a path segment equal to one of the mentioned names. This means I cannot have a route like this: {controller}/{...
Max Toro
12

votes
3

answer
12.1k

views

Can you build a RESTful Business Logic Layer?

I've built a RESTful service for the Data Access Layer (DAL) of my architecture: POST http://example.com/data/User GET|PUT|DELETE http://example.com/data/User/{UserId} However, for the Business Logic Layer (BLL), a second non-RESTful service is used: POST http://example.com/accountapi/register POST...
Max Toro
3

votes
2

answer
156

views
3

votes
2

answer
142

views

how to check if assembly was written in VB

I want to check at runtime if an assembly was probably written in VB. It doesn't have to be a bullet-proof method. Maybe call GetReferencedAssemblies() and check for an assembly that all VB projects reference?
Max Toro
1

votes
3

answer
788

views

What can WCF WebHttp do that ASP.NET MVC cannot?

Please, no 'They solve 2 different problems' answers, it's the same HTTP request and response problem. Just because you have views/templates in MVC doesn't mean you have to use them. M_C is good enough for serving XML and JSON. Please, no 'It's what Microsoft says you should do' answers. If I though...
Max Toro
3

votes
2

answer
1.1k

views

Entity Framework pipeline: Expression trees to ESQL to SQL?

What is the Entity Framework pipeline like? What gets translated to SQL, Expression Trees or ESQL, or both? Is ESQL something an Entity Framework provider needs to implement or translate, or that the framework takes care of?
Max Toro
3

votes
2

answer
1.1k

views

when should I use the session-per-request pattern

I see this pattern everywhere, but Linq to SQL does not implement it. If Session/Unit-of-Work objects are lightweight (can be created and destroyed without performance penalty), and connection pooling keeps database connections alive, why and when do I need the session-per-request pattern?
Max Toro
3

votes
1

answer
257

views

Oracle AS keyword and subqueries

Just found out that Oracle does not like it when you use the AS keyword to alias a subquery: SELECT * FROM (SELECT * FROM products) AS p I need to keep my SQL queries as portable as possible. Will the removal of the AS keyword in the above query affect any other RDBMS?
Max Toro
6

votes
2

answer
970

views

ASP.NET 5 name confusion [closed]

If ASP.NET 5 is a new runtime that runs on both .NET Core and Full, then what should we call the current ASP.NET, or anything that depends on System.Web, when .NET 5 is released? I suppose ASP.NET 5 takes the number 5 from the next version of .NET, which will continue to include and support System.W...
Max Toro
4

votes
1

answer
1.7k

views

Can I disable DataAnnotations validation on DefaultModelBinder?

I want DefaultModelBinder not to perform any validation based on DataAnnotations metadata. I'm already using DataAnnotations with DynamicData for the admin area of my site, and I need a different set of validation rules for the MVC based front-end. I'm decorating my classes with the MetadataType at...
Max Toro
7

votes
1

answer
102

views

Why do I have to parent-type-qualify to use a nested type when inheriting from a generic type?

Consider this: [SomeAttr(typeof(Bar))] class Foo { class Bar { } } ...and this: class Foo : ISomething { class Bar { } } The first example compiles, the second doesn't. To use a nested type reference when inheriting from a generic type I must qualify it with the parent's type name: class Foo : ISome...
Max Toro
4

votes
2

answer
1k

views

ASP.NET MVC 3 Gotcha (Bug?): Different parameter binding priority for GET and POST

Given this route: routes.MapRoute('home', '{action}/{id}', new { controller = 'home', action = 'index', id = UrlParameter.Optional }); ...and this action: public ActionResult Hi(string id) { return Content('hello, id: ' + id); } Question #1 What is the response for: GET http://localhost:2247/hi/7?id...
Max Toro
6

votes
2

answer
1.3k

views

.NET primitives and type hierarchies, why was it designed like this?

I would like to understand why on .NET there are nine integer types: Char, Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, and UInt64; plus other numeric types: Single, Double, Decimal; and all these types have no relation at all. When I first started coding in C# I thought 'cool, there's a uint t...
Max Toro
2

votes
0

answer
90

views

Are JavaScript frameworks web frameworks? [closed]

AFAIK, the web has three components: HTTP: Application protocol (more than transport) HyperText: HTML or other format with links URL: Embedded in the hypertext for next allowed state transfers Do JavaScript frameworks adhere to this flow? I ask because I'm curious why a document like ROCA is even ne...
Max Toro
5

votes
2

answer
1.1k

views

WCF return types

What is the list of valid WCF return types? I know some but I want to know all of them: Primitive types (string, int32, etc...) Complex types with DataContract or Serializable attributes Stream Message SyndicationFeedFormatter void? POCOs?
Max Toro
10

votes
2

answer
835

views

Is a parameter name change in C# a runtime breaking change?

I read a couple of articles that say that with the introduction of named arguments in C# 3.0, the name of parameters are now part of the public contract. Is this true, and what does it mean exactly? I ran a simple test and changing a parameter name in MyLib.dll did not break MyApp.exe which called t...
Max Toro
2

votes
2

answer
993

views

Get column default values with ADO.NET

I want to get the default values of all columns of a table so I can display them in the data-entry form, is there a way to do this using ADO.NET ? I know I can query the information_schema database for this info, I'm just wondering if there's a built-in way to do this in ADO.NET
Max Toro
2

votes
2

answer
282

views

What is the aspnet50 target framework, and can I reference it from VS2013?

The packages at https://www.myget.org/gallery/aspnetrelease target aspnet50, and when I try to install them I get: You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are comp...
Max Toro
2

votes
1

answer
120

views

Symbol server vs. including pdb files in package

What are the benefits of using a symbol server instead of simply including the pdb files in the nuget package?
Max Toro
296

votes
3

answer
117.3k

views

.NET 4.0 has a new GAC, why?

%windir%\Microsoft.NET\assembly\ is the new GAC. Does it mean now we have to manage two GACs, one for .NET 2.0-3.5 applications and the other for .NET 4.0 applications? The question is, why?
Max Toro
10

votes
8

answer
1.1k

views

What's the purpose of the empty string?

To me, as a developer and as a user, I find the empty string ('') useless and the cause of much confusion, it's like saying string == char[] Maybe computers need the empty string, so I'd like to learn why. See also: Default string initialization: NULL or Empty? Best Practice: Should functions return...
Max Toro
7

votes
2

answer
845

views

What is the FDG for naming boolean properties?

What is the Framework Design Guideline for naming boolean properties? If there isn't one, then what's your recommendation? Let's say I have a User class, and I need a property that specifies if the user is enabled or not. These are the options I can think of: Enable Enabled IsEnabled Disable Disable...
Max Toro
5

votes
2

answer
4.4k

views

Best way to test if a Type is a collection

I have a method that accepts a parameter obj of type System.Object Now I want to check if the actual type of obj is: A collection type (IEnumerable). Anything else. The first way I thought of is: if (obj is IEnumerable) // obj is a collection But System.String implements IEnumerable, and I don't wa...
Max Toro
6

votes
3

answer
1.1k

views

Can IL produced by C# 4.0 compiler run on CLR 2.0?

Can IL produced by C# 4.0 compiler run on CLR 2.0? To clarify, I'm not asking about VS 2010 multi-targeting (where VS chooses the right compiler version), I want to know if csc.exe 4.0 supports multi-targeting...
Max Toro