app-code

ASP.NET MVC using App_Code directory

吃可爱长大的小学妹 提交于 2019-12-04 15:50:52
I've added an App_Code directory to my ASP.NET MVC project so that I get dynamic compilation for plugins. Only slight annoyance is that when developing new plugins, I don't get intellisense on classes inside the App_Code directory. Currently I am creating them in another directory inside my project and then copying them into App_Code. is there any way around this? [Update] I've posted an "answer" below. Technically this answers the question as based on my own specification, the use of tools (i.e. intellisense) should not be required to create plugins. However, this did prompt a question of how

My ASP.NET App_code changes not getting picked up (or are cached??)

佐手、 提交于 2019-12-01 04:05:11
Help!! I have a single .cs file under a (root level) App_Code directory for the purpose of retrieving the correct template for the requested URL (it is linked to our own Content Management database). Initially, it was working fine - I could make changes to it and they were picked up by the web application OK. Then something happened (no idea what) and now whatever changes I make, they are not recognised. Even if I delete the entire App_Code directory, it makes no difference - I still seem to be picking up an earlier (cached??) version of what was in the App_Code directory. Code in the .cs file

My ASP.NET App_code changes not getting picked up (or are cached??)

狂风中的少年 提交于 2019-12-01 01:44:28
问题 Help!! I have a single .cs file under a (root level) App_Code directory for the purpose of retrieving the correct template for the requested URL (it is linked to our own Content Management database). Initially, it was working fine - I could make changes to it and they were picked up by the web application OK. Then something happened (no idea what) and now whatever changes I make, they are not recognised. Even if I delete the entire App_Code directory, it makes no difference - I still seem to

NET: Best Practices/guidelines for dividing namespaces between files?

こ雲淡風輕ζ 提交于 2019-11-30 18:43:02
What should be the general guidelines/gotchas for dividing application code (App_Code) into separate files? I've found that over time, the original files do not match up well with how the namespace hierarchy evolves. How do I keep application code containers organized intuitively over time? What PURPOSE should the file divisions aim towards? Code portability? Separation of concerns? General functional context? Frequency of change? Should they strive for 1-1 relationship with classes? What are the implications of splitting the code into MANY smaller files vs consolidated into few files? I've

Can I have a global razor @helper outside of App_Code?

蓝咒 提交于 2019-11-30 11:02:52
The question is simple as stated in the title: Is there a way of having razor helpers outside of 'App_Code'? Example ( HtmlEx.cshtml file ): @helper Script(string fileName, UrlHelper url) { <script src="@url.Content("~/Scripts/" + fileName)" type="text/javascript"></script> } I ask this because I don't really have anything else to put in App_Code; I want to structure my project a bit different. Thanks. UPDATE: I don't want any other type of extensions. I am interested in only pure razor helpers as Scott is speaking about here: http://weblogs.asp.net/scottgu/archive/2011/05/12/asp-net-mvc-3-and

Clean conflicting class files from Temporary ASP.NET Files

筅森魡賤 提交于 2019-11-30 10:09:59
Class file Conflicts in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ is preventing me from building the solution. Even though I try emptying out the folder, each time Visual Studio starts the build process, it brings in the class file in to the temp folder with the same folder name. If I restart the machine or leave it overnight, project build without error. Is there anyway to tell Visual studio to delete/ignore/clean any lingering class files that could be in the temp folder? Clean solution option in VS doesn't work either. Class file in conflict are from the App

ASP.NET web site can't see .cs file in App_Code folder

南笙酒味 提交于 2019-11-30 06:58:12
So I have an ASP.NET web site (not web application) I'm making in VS2010 with C#. It runs fine on my machine, but when I upload it to the site it's hosted on, it won't compile, giving: "CS0246: The type or namespace name 'DataAccess' could not be found (are you missing a using directive or an assembly reference?)" I've been using the copy web site feature in VS and had no problems until I wanted to put my own class in the App_Code folder and use it. I read in other answers about changing the .cs properties to "Compile" instead of "Content", but there's no such option for me in the properties

NET: Best Practices/guidelines for dividing namespaces between files?

☆樱花仙子☆ 提交于 2019-11-30 03:03:03
问题 What should be the general guidelines/gotchas for dividing application code (App_Code) into separate files? I've found that over time, the original files do not match up well with how the namespace hierarchy evolves. How do I keep application code containers organized intuitively over time? What PURPOSE should the file divisions aim towards? Code portability? Separation of concerns? General functional context? Frequency of change? Should they strive for 1-1 relationship with classes? What are

Can I have a global razor @helper outside of App_Code?

别等时光非礼了梦想. 提交于 2019-11-29 16:27:42
问题 The question is simple as stated in the title: Is there a way of having razor helpers outside of 'App_Code'? Example ( HtmlEx.cshtml file ): @helper Script(string fileName, UrlHelper url) { <script src="@url.Content("~/Scripts/" + fileName)" type="text/javascript"></script> } I ask this because I don't really have anything else to put in App_Code; I want to structure my project a bit different. Thanks. UPDATE: I don't want any other type of extensions. I am interested in only pure razor

Clean conflicting class files from Temporary ASP.NET Files

99封情书 提交于 2019-11-29 15:05:09
问题 Class file Conflicts in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ is preventing me from building the solution. Even though I try emptying out the folder, each time Visual Studio starts the build process, it brings in the class file in to the temp folder with the same folder name. If I restart the machine or leave it overnight, project build without error. Is there anyway to tell Visual studio to delete/ignore/clean any lingering class files that could be in the