I inherited this code from another developer (3rd party) but I am implementing it. Its a large website done in c#. For twitter integration they must have created a new website project because the code inside the sub folder has its own bin and app code folder. This is published on IIS but its a strange setup where it compiles at run time. (If I make a code change to a file on the webserver and save it, it updates instantly without having to publish).
This subdirectory is throwing a 500 error and I assume its because I dont believe you can have multiple bin and app_code in the same website project. Is that a correct assumption. Should I combinbe all the app_code directories to the one in the root? Here is a more visual example of the directory layout:
MyWebsite
App_Code
BIN
...other folders and files
MySubdirectory
App_Code (ALLOWED??)
BIN (ALLOWED??)
App_Code and Bin are special folders only at the root of the application. You should make MySubdirectory a child application in IIS.
Related
I have recently purchased a shared web hosting package, provided by GoDaddy, and deployed my own MVC web application to it.
My problem is that, when on the control panel (Plesk) provided by the host, I can't find the Controllers folder that contains all the behind code.
Is there a reason for this folder being hidden?
I'm guessing it's because the files within this folder are being used by the server all the time and can't be accessed/changed incase it f--ks everything up... But I am not sure about it because I am quite new to web hosting.
Thanks for any assistance in advance.
All your cs files including controllers will be compiled into DLL files. Please open "bin" directory to find all your DLLs.
When you deploy, u ll not get controller, because it contains c# code which changed to dll available inside bin folder.
Not Only Controller, the other folders which are having C# code like "App_Start"...and etc...will be changed to dll and will be available inside bin folder.
In the case of Model/s, if you are using Entity framework, then, the .edmx file will be available inside the Model folder.
All your Business logics including controllers, models and core etc are converted to dll and by Assembly name dll is created in bin (released or debug folder)
Consider Asp.net Website (not web app) with .Net 4.5 framework.
With multiple cs / aspx / ascx files in many different folders outside App_Code folder.
App_Code folder compiles perfectly. Able to map with IIS and browse few pages.
But many files present outside the App_Code folder contains errors, during build / rebuild, it shows only one error at a time. Once that error is fixed, during next build, again error is thrown in some other in file outside App_Code folder.
How to display all the errors?
I mean, like, when there are errors in multiple C# files present in App_Code folder, all the errors get displayed in Error window. Same thing how to configure for files present outside App_Code, so that error finding will be faster?
I created a ASP.NET MVC project on one machine, when it came time to upload to the server, I'd just copy the Views and the Bin folder, no Controllers or Models.
However when I copied the project to another machine, the Bin folder is not being updated with a new compiled dll so I can't just copy the bin folder.
What setting do I need to tell VS2015 Community to compile the Controllers so I only need to compile the Controllers and copy just the bin folder?
Admittedly, I should've mentioned it was an ASP.NET rather than a desktop application.
It looks like what I had to do is make the site into a Web Application and there's no easy way, if there were, it'll be found at Microsoft site which the closest I found to the answer is :-
https://msdn.microsoft.com/en-us/library/aa983476.aspx
I created a new project and then copied the files across to the new one. Unless there's an easier way, thats the only solution.
In my mvc3 web project I have an App_GlobalResources folder containing the resource file Permissions.resx.
I am able to access the values in this file when I run the site locally in visual studio using:
string value = (string)HttpContext.GetGlobalResourceObject(resourceClass, key);
However, once I deploy it to the production web server it is not able to access the values in this file. I checked and it is creating App_GlobalResources in the bin folder of the publish directory containing the file.
My first time using global resource files, is there any additional steps required to get this working once deployed to the webserver?
Thanks.
I'm pretty sure App_GlobalResources should not be created in the bin folder. Have you got Copy to output folder set? (You shouldn't need it).
In WebForms, in properties of the .resx files, we have Build Action set to Content and Custom Tool set to GlobalResourceProxyGenerator. This creates dlls for the resources in the bin folder.
However, I've not used App_GlobalResources in MVC (it makes things tricky to test outside of a web context), but there's some info here that might be useful:
http://odetocode.com/Blogs/scott/archive/2009/07/16/resource-files-and-asp-net-mvc-projects.aspx
I'm creating a web service that uses multiple DLLs, some of which are projects that I have developed and others are external DLLs. Those that are external, I have simply copied into the Bin directory of my WebService. However, those that are from my own projects I have added as references by right clicking on the bin folder and selecting add reference. This adds both a dll and a pdb file to the bin folder. However, when I build the website, I am not sure where these two files are pulled from. I need to know because I am trying to encrypt these DLLs as a post build step on the web service and I need to know where I can find the DLL I should encrypt. Need any more information let me know.
If the files are part of another project in your solution, then open the project folder for those projects (right click on the project node in VS and choose "Open In Explorer..."). There is a bin directory in that folder that the assembly for that project is placed in after it is built. When the web site project is built, the assembly is copied from this bin folder into the bin folder for the web site.
EDIT
As discovered (in the comments to this answer), VS actually copies assemblies from the obj directory rather than the bin directory.