views:

38

answers:

1

I converted a ASP.Net website to ASP.Net web app and changed the framework from 2.0 to 3.5

The web application works fine in Visual studio. However, If I compile the app in a dll, and try to reuse its middle layer in another web project, All the classes that have a static variable crash. Code like:

public static string myString = "Something";

However if I convert it to a property like this:

`public static string myString {get{return "Something";}}`

, it works. Anyone knows te reason?

A: 

I may be mistaken, but I think it's because static variables are interned at compilation time.

Have you recompiled the other web project before using it ? That could be the reason. (but again, I have no certainty)

Shimrod