I want to know for sure if there are any possible issues for not publishing an ASP.NET solution.
In my company current policy (strangely) they just copy the web project dll, and needed references dlls, web.config and global.ASAX and image files over the existing ones on the IIS web server(Virtual Directory is created).
Do you see any issue with the above?
Your feedback is greatly appreciated.
Don't really see a problem with this. It's sort of what we do. We publish to a folder - any folder, check the web.config against live, then zip it up. We then create a change request, referencing the zip file & pass this to the hosting team to deploy.
This works great for us, but then everyone has different views & circumstances. I don't really see it as a technical issue, but more of business process issue.
It used to be that you copying files was not good enough, because you needed to create a virtual directory/Application within the IIS configuration system for your applications. Recent versions of IIS allow you to handle this entirely within the app.config, and so it's much less of an issue.
Related
I have an asp.net website on a HostGator shared windows server (set at medium trust) that uses the Amazon Web Services. It uses a .dll file called Microsoft.Web.Services3.dll
I do not know how .dll files work, but somewhere inside, there is an instance of System.Reflection that requires a trust level full. This is the only line that is breaking my website and yet I need the .dll to get the Microsoft.Web.Services3 namespaces imported.
Does anyone have any experience with .dll files that can help me get past this problem? I am happy to provide any extra information that might be useful!
I have two different applications deployed on common shared hosting (using hostgator services).
One application is deployed on root folder and another one is deployed in sub-folder created on root. But the application deployed in sub-folder is not using web.config file available in sub-folder, it is using same web.config available on root folder.
Please help me to find out way how to use different web.config files for all different sub-folders on shared hosting.
The only way to have a subdirectory act as a separate application with its own web.config is to configure it to be a separate IIS application.
In a dedicated hosting environment, you'd do this within IIS. However, the fact that you're on a shared hosting platform doesn't automatically make it impossible. Most shared hosting provides a web interface that you use to configure your site, and often - but not always - that interface will give you the ability to set up subfolders as separate applications.
I can't tell you whether you have this option or where it is, since I don't know what control-panel software/product your hosting uses (and even if I did, I probably wouldn't be familiar with that specific product/version, but it's worth having a dig around in your control panel to see if you can find it somewhere. If not, try contacting support - they might be able to point you in the right direction, they might offer to do it for you in IIS, or worst-case scenario is that they'll tell you they don't offer that service (at least then you'll know, and can start looking elsewhere for a new host).
Unfortunately, there's no other way to do this - you can't for example add a setting to the root web.config to tell it to treat a subfolder as a separate application, because applications exist at the IIS level not the ASP.NET level.
In general, the code in the subfolder should be using the web.config in the root folder, plus the web.config in the subfolder. Exactly which settings are not being used in the subfolder?
It is not necessary to have the subfolder be an application just in order to get the two config files to merge. It is necessary if you want the sub web.config file to be independent.
I'm having a "tiny" issue with my App_Code folders.
I'm learning ASP.NET and, therefore, ordered a webserver with the support of ASP.NET 4.0. I'm using Visual Web Developer to program my webpages. When I upload my website to this webserver everything runs fine.
However, if I then add another web project to my server, my App_Code folder gets all messy. The server wants all my class files in the App_Code folder in the root. Is there any way I can create subdirectories in my App_Code folder or something to keep my projects organized or am I missing the point here?
You should take a look at codeSubDirectories in the web.config
Alright I found a solution to my problem. Although most of your answers might work aswell, this proved to be the best in my case. I created a subdomain and threw all files into that folder and it worked fine.
You should try to avoid using the App_Code folder for your own stuff, especially if you're using a web application project.
Whenever you convert a website to a web application project, the process actually renames your existing App_Code directory to Old_App_Code.
See Here, even though this is specific to converting .net 2.0 apps, I believe it still holds true in 4.0 since converting a 4.0 app does the same thing.:
VERY, VERY IMPORTANT: Because ASP.NET 2.0 tries to dynamically compile any classes it finds under the /App_Code directory of an application at runtime, you explictly DO NOT want to store classes that you compile as part of your VS 2005 Web Application Project under an "app_code" folder. If you do this, then the class will get compiled twice -- once as part of the VS 2005 Web Application Project assembly, and then again at runtime by ASP.NET. The result will most likely be a "could not load type" runtime exception -- caused because you have duplicate type names in your application. Instead, you should store your class files in any other directory of your project other than one named "app_code". This will be handled automatically by the "Convert to Web Applicaiton" command. This command will rename the folder Old_App_Code.
If you have access to a hosting control panel it's probably best to configure your hosting environment with a virtual folder for your second website and run it from the sub folder, e.g. www.example.com/project-b. The first site can still be running in the root folder, e.g. www.example.com.
So both sites will essentially be isolated from each other (just like they are now isolated as two separate projects in Visual Web Developer Express). And both sites have their own App_Code folder (and web.config file).
If you don't have access to a configuration panel, most hosting providers are willing to add a virtual folder for you, since it's really not a special requirement.
The virtual folder should show up as a regular folder in your FTP folder, usually inside the www or wwwroot folder. Now you can copy your project files into that folder.
Take care to use root-relative paths for URLs in your second project, so all links will work even when the website is run from the subfolder. Root-relative URLs look like this:
<asp:HyperLink runat="server" NavigateUrl="~/Default.aspx" />
<asp:Image runat="server" NavigateUrl="~/images/logo.png" />
This will automatically go to www.example.com/project-b/Default.aspx and www.example.com/project-b/images/logo.png when the website is deployed in the virtual folder.
If you need to re-use code from one site in the other, it's typically best to move such code into a separate Class Library project type, and then add a reference to that project to each website project (right-click the website project, choose Add reference..., then select the Projects tab and select the Class Library project).
Good day all,
I have written an application that i require to have a certain directory structure/. Nothing complex but it will need an "Images" Folder which contains two other folders "Temp" and "Complete".
These folders are in my solution however upon publishing all the folders are gone and i can not find any way in which to cause these certain folders to persist.
Will i have to write some code that checks if these exist and create them or can i make an application directory structure exist from the very beginning.
Dont know if this is relevant but i am using WPF and deploying through click-once.
Thanks,
Kohan
Regardless of whether you find a solution to the installation part of your question it would be prudent to check that the folders exist either on application start up or when you need to access them. After all, someone could come along and delete them without realising that they're needed. You might want to report or log this as an error, but recreate them anyway.
I assume you are using Visual Studio to create your ClickOnce deployments. If so, you can get around this issue by using MageUI instead.
Create your desired folder structure separate from you project's source code and bin folders. Copy in all the files you want deployed. Use MageUI and when you create the application manifest, point it to the root folder you created. It will take care of all the subfolders.
Also, I wouldn't worry too much about what ChrisF said. ClickOnce files are deployed to a very obfuscated location that users should never be in. And if they are in there deleting stuff, you'll likely have much bigger problems that a missing subfolder.
The problem is I reinstalled my computer and the backup didn't work so now all my sourcecode is gone... But my webservice is still running on a webserver.
When I upload the new website the old site will be deleted, so how can i backup the webservice and make it a part of my new website?
In the bin folder of the webserver there is some strange name files like App_web_cjcpmkr8.dll,
can I just download these files and .asmx files? Isnt there then missing a link between the files? How can I see which .asmx files uses which .dll files?
Unfortunately they're all compiled- depending on your site's config, there will be either one assembly per page or per directory. You can download all the DLLs and decompile them through reflector- the decompiled class names should help you match them up with the corresponding markup, but you'll still have some reconstructive surgery to do.
The magic link between the asmx and the dlls lies in the name of the bin folder. IIS will automatically look for dlls in this folder. You should be able to deploy your web service on a new web server by just copying the files. I recommend that you try to set up a copy of the service on a new web server, before you delete anything.
If this is critical data get a service to try and get your files back. If not then moving forward invest in an online backup solution / source control utility.
This will save you tons of time when this happens again. I use source control on a remote server combined with a subscription to Carbonite locally to ensure that I don't lose that precious data; both the data checked in and the data that I'm currently working on. It's Iike $45 a year and well worth it.
As for your data I'm sorry that you've lost it. I'm sure you’re not the first to have this happen.