how to run asp.net dlls? - asp.net

I've got 4 ASP.NET DLLs and the source.
When i compile it it says its not able to run it because it's a class library. I know, but how should I run those files. I haven't got any aspx files or anything, just the 4 DLL's.

What do these DLLs do that needs to be run? Do you just need to quickly debug/test some functionality in them or something? A quick way to do that would be to just write a simple little console app and reference the DLLs in it.

You don't run an ASP.NET application like you do a normal program. It has to be hosted on a web server (either IIS, or the built-in server in Visual Studio), and then accessed by a browser, through a URL.

Related

VB.NET ASP.NET Web Application. Advice on getting ready for deployment

I was hoping for some advice on the correct approach to get my asp.net vb.net web application project completely ready for deployment. I recognise that I switch to release mode and compile. So I have my server-side code successfully compiling into a .dll file in the BIN folder, this is exactly what I want.
The issue where I am unclear is with the aspx.vb files and the aspx.designer.vb files that are attached to the .aspx files, I am using VS2010. I want to remove all of these from my project so that any of our potential clients have no direct access whatsoever to any of the server side code.
I have decompiled the .dll file and can see that it is all in there so I am fairly certain if I remove the code behind files the program will run without any difficulties. As I have never done this before I was hoping for some basic tips. Is this the correct approach to take? If so is there a standard good approach for removing the aspx.designer.vb files and the aspx.vb files from a given project within Visual Studio, or is it a case of manually taking them out of the release mode?
Thank you for any tips.
The code behind files are compiled into the dll in a web application so you don't need to deploy the .vb files (nor do you want to).
The dll is not obfuscated by default so anyone could decompile it to see your source however. There are free and non-free obfuscators available but that is outside the scope of this question really.
The easiest way to deploy is to use visual studio to do this for you (I think you might need pro version or above)
You can set up your own test web server locally and deploy to that first to see which files are in there.

Deploying a Visual Studio website vs web application

So I'm using visual studio 2010 to build a website that was formerly running on PHP, so I'm pretty new to the environment.
In starting the project I built a website project, not a web application project. I know that will probably generate a lot of "never use a website project, use a web application project instead" comments, but bear with me.
I'm attempting to provide our server team with the necessary files to compile on our server for the first time. However they're used to working with web application files, not website files.
Normally they are given the source code and a batch file that compiles the code into deployment directories and then they just move the files to the server from there. I'm pretty sure that the other teams use deployment packages to do this, which obviously isn't an option for a website.
My question is, what would be the equivalent steps for getting the source for a website ready to deploy vs a web application? I have published the website to a separate folder and this has rendered what I think is the equivalent in many ways, but I wanted to make sure.
Also, is it possible to publish certain parts of a website without others?
Please with-hold all the comments about how I should be using a web application instead, google seems to assume that's all that's used out there too.
Thanks!
There isn't much to deploying a web site other than copying the source files to a directory in IIS. It will compile the site automatically on the first page request.
I agree with Britton. I personally prefer web application but with the web site project you have 2 options.
Either a) Upload all the files (including the .vb or .cs files) and the web server will compile on the fly. OR, you can publish to a separate folder locally on your machine, and then upload that folder. I would do the publish if you don't want anyone seeing your source code.

Turning a precompiled web app to a 'normal' web app

I've got a quick question about precompiled web apps:
I've recently took over a project done by someone else, which is a precompiled web app. This means that it has no App_Code folder, of course. Due to the nature of this project I would like to put my code on the server anyhow.
I can't just add the code, because I'll get an Exception stating that the App_Code folder isn't allowed because it's a precompiled web app. If I remove the file 'PrecompiledApp.config", then my application crashes.
So what are the correct steps in turning a precompiled web app to a compile-on-demand webapp?
Thanks for the help.
I can get this working in VS2010.
Go to your web app settings and select the Package / Publish Web tab. There's a drop down that's probably defaulted to 'Only files needed to run this application'. If I use this it just publishes the compiled DLLs to the server and the web files, but none of the code.
If I change this to 'All files in the project folder' then I get everything - all the C# code for my controllers, for example.
Of course whether you would want your production code on a server is a different question, and you also get all the VS solution files and stuff like that too so it looks quite messy.

Use WPF DLL Assembly in ASP.NET problem

I have C++ project that compiles as DLL Assembly in .NET 3.5 SP1
Project is used for Image rendering processing by using WPF (it loads 2 images from local folder, applies one image on another and saves the output file in the same folder).
I want to use that that project as a reference in ASP.NET project to the rendering on the website.
So I created simple Web Project in ASP.NET C# that uses C++ project as a Reference.
Everything works great in ASP.NET Web Development Server (built-in Web server in VS2008).
But once I publish this project to IIS on the same Machine or use IIS for debug instead of built-in Web server Image rendering it's not working anymore. I'm not getting any exceptions or error messages, it just output image is not processes as it supposed to be.
If anyone know what could cause that I would really appreciate your insight!
Do you have access to the Event Logs? You should check there for any errors. You should try to throw an exception from a C#-only code path and make sure that everything is OK and regular exceptions are being thrown. Is the C++ compiled to managed code, or is native code? You might find that ASP.NET does not have the appropriate code access security permissions and needs to be registered in the GAC of the server to accessed from C#.
You should also check whether the DLL is thread-safe. This has caused issues for other users in ASP.NET/IIS.

Publishing an asp.net web application

I want to know a few things about Publishing an asp.net web application,
Why should i publish my web application?
What are the advantages of publishing a web application?
1- if you want to crypt your configuration settings you should publish. http://msdn.microsoft.com/en-us/library/53tyfkaw%28VS.80%29.aspx
2- first if you just copy your web site to your IIS it will compile first then starts serving. publishing wins that compile time. second if you want to send just dlls to your server it will be easier to deploy.
my personal opinion if you are the only developer on the project and you may need to change stuff on an editor like notepad and deploy ASAP then dont do it.
but if you have a big team and timeline and deploy is a one of a big issue for project. you need to do that to keep track.
You should use web application because of the advantages of Web application. :-)
I think web application has some advantages:
Web application will be compiled before published, so the code will be checked by compiler.
One web application(project) has only one DLL file.
use dll file and not use source code
can encrypt file

Resources