Including links to external resources in Visual Studio 2010 Web project - asp.net

I have a ASP.NET project which relies upon the FreeImage .NET wrapper. This is loaded using a reference to a external directory. The wrapper relies upon the FreeImage.dll being present to work (clearly).
How do I get Visual Studio to include a reference to the FreeImage dll. It's not a .NET assembly, i think it was built in something else (so I can't add it as a reference).
I don't really want to have a copy for this project as these files reside in a different SVN repository

Add a pre-build macro/script to copy the file across each time you build. There's no way to add a symbolic link into a visstudio afaik.

I am assuming the .dll was built using a .NET supported language like C#.
You can just right click over the site and select 'Add Reference'.
Browse to the .dll you are looking for and then click 'Ok' to add it.
It should add a .refresh file to your site and the dll. The .refresh file is what is checked into your source control letting the site know the relative location of the .dll to the site.

Related

What files do you check-in to source countrol management system when working in an ASP.NET web application?

We have a main web application that references several other projects. Do you check-in .csproj/.sln files into source control? If so, do you use these files for msbuild or do you just include *.cs to build your dll? Does ILMerge help in any way with performance?
You should aim to check in everything that is needed so that someone can take a fresh install of Visual Studio, do a checkout, double-click the .sln file, build and be on their way.
.sln and .csproj are a no-brainer, in my opinion: what happens if you add a new file to the project: everybody would have to manually add the file to their project files if you didn't commit the .csproj file.
ILMerge - no. Not for web applications. Not for the rest either.
Checkin? What about letting visual studio handle it. Now, in general - source control without all relevant files is garbage ;) So, it should include stuff like the project and solution.

Visual Studio 2008 doesn't create *.refresh files for external DLL references... what am I missing?

I've got a question about something that's just been irritating me.
A colleague and I are building a support framework for our current client that we want to reference in other projects.
The DLL we want as a reference in our project would be an external reference. We're adding it by doing "Add Reference...", then browsing to the location of the .dll. What I want Visual Studio to do is only add the .xml, .pdb, and a .dll.refresh file, but instead it copies the actual .dll (and .xml and .pdb) into the bin.
When we rebuild the framework project, the other project that uses its .dll gets all out of whack until we drop and re-add the reference. Everything I've read online says that VS2008 is supposed to create the .dll.refresh files for you, but it never does.
Any ideas? Am I missing something or doing something wrong?
At this point I'm ready to add a pre-build event to simply copy the framework .dll into my bin, but the .refresh file seems like less of a hassle if it would just work.
Thanks.
UPDATE:
This SO post describes the actions that are supposed to be happening with the refresh files.
So it turns out that .refresh files are only created for Web Site projects, not Web Application projects.
The problem stems from Visual Studio having trouble deleting lock files for DLL references over 64kb, a problem supposedly fixed in VS 2010.
The current workaround is to close and reopen the solution or to unload and reload the project containing the references.
If the Projects are in the same Solution and you add a "Project Reference" that should solve your problem.
You can try to add references another way.
Add reference
Choose tab Browser (Not tab Project)
Choose *.dll that you need
I have tried it and been successful.
If you choose tab Project --> there are no *.dll.refresh added

Restoring web reference in Visual Studio 2008

I had a web reference set in my VS2008 ASP.NET project, but due to some source control weirdness it is no longer listed in the project.
I have the set of files in the Web References folder under my project. There's a .wsdl, .disco and several .datasource files.
Is there any way to re-add this web reference through the existing files rather than using the "Add Web Reference" dialog?
Resolved now.
The project file had all the references in the source control version, but the source control insisted the local file matched the server version.
Digging through the file's history showed that my local version didn't match and an update resolved it.
I think Source Safe needs the repair utility running on it.

Finding the .Net framework

Is there a way to find out which .Net version i.e. 1.1 or 2.0 or 3.0 etc.. was used to create a web project. I have files like .aspx, .aspx.vb, web.config etc but need to figure that out.
Also how to open the existing ASP.Net project in Visual Studio environment. I have received files from another person but for security reasons he do not want to share the complete project but only selected files. We both would like to know what is the bare minimum files which needs to be shared to open an existing project (I mean apart from the .aspx, .aspx.vb files which needs to be modified)
Thanks
If its ASP.NET project check the <assemblies> element in web.config its must contain versions of each assembly you use.
Please try this:
Open Visual Studio.
Click on File -> Open -> WebSite (Or press Alt+Shift+O).
Select the folder which containing your file (aspx, aspx.vb, web.config)
In most of the cases it will open the folder as web site and you can run it with F5.
I don't think the files you mentioned will contain any references to the version of .NET they were build under, not unless they feature version-specific code & functionality (LINQ for 3.0+. generics for 2.0+ etc).
In order to open an actual Web project in Visual Studio, you need the project file. Without that you will only be able to open individual files.

Attach DLL to ASP.NET Site

How do you attach a DLL to a asp.net site? I want to be able to debug and edit the DLL without having to keep replacing the reference in my asp.net site. I checked attach to process but didn't see the worker process. I am using asp.net, IIS 7.
Just put it into /bin folder of your web application.
OR
Add reference to this .dll by right clicking on References > Add Reference > Browse > Select your .dll file and lick OK.
Then set it's "Copy Local" property to "True". This way .dll will be copied into /Bin folder each time you build application.
alt text http://xmages.net/out.php/i170817_1.png
Using Visual Studio you should create a solution that has your website as a project and the DLL (code) as another project. Make a reference in the website project to the DLL project and it should update it automatically.
If you are not using the web application model and just the website model you could just have your DLL project output to your website's /bin directory directly. That will update the DLL in the website/bin folder whenever you build your DLL project.
If you want to edit the dll, open that project up in a second instance of Visual Studio and treat it like you would for any other project.
Set the reference in your /bin folder to the debug dll that the second Visual Studio creates.
I'm assuming you have Visual Studio...
If you're just trying to add a dll, you can add a reference to it by right clicking on your website node and choosing "Add Reference..." .
You will be able to debug the dll if you have its pdb along with it (to load the symbols from). You will NOT be able to edit the dll.
If the dll is in fact another project you have the source code for, just add the project to your solution, and from your website project add a reference from the "projects" tab. VS should add a reference and dependency so that it keeps the dll updated when you change code in your dll project.

Resources