ASP.Net Change reference from GAC to File - asp.net

I need to do two things...
Change the reference from GAC to file. As you can see, I don't have a References Folder.
There is only a Debug build. How do I create a Release build and publish that.
Why is this project so different to any other web site I have created?

Related

What's a bin.net3.5 file

What's a 'bin.net3.5' file that gets created in the same folder as the VS2012 solution that contains an ASP.net website?
I would like to mention that this is a file and I am not referring to the project's 'bin' directory where projects' compiled dlls will be placed after a build.
As discussed it seems that this is something related to your project specific file. There is no such standard file created by Visual Studio 2012
Bin Folder
ASP.NET recognizes the Bin folder of a website as a special folder for
specific types of content. A Bin folder is meant to contain compiled
assemblies (.dll files) for custom ASP.NET controls, components, or
other code that you want to reference in your ASP.NET web application.
You can store compiled assemblies in the Bin folder, and other code
anywhere in the web application (such as code for pages) automatically
references it. A typical example is that you have the compiled code
for a custom class. You can copy the compiled assembly to the Bin
folder of your Web application and the class is then available to all
pages.
Some DLL's are kept in different folder names to determine the version, you'll notice when using nuget, the dll's will go into a packages folder, and are often split as net40, net45 etc
When you build the project, your Dll's will go into the Bin directory.

VS2010 not obeying Output Path

I have a VS2010 Web Application Project that's compiled to bin\subdir\ via Output Path and without build events.
There's a few other projects that my main project is referencing but for some reason the dll's for the other projects goes into BOTH bin\subdir\ AND bin! It only applies to other projects - if I reference a dll in my main project and set it to Copy Local it will only go to bin\subdir.
I have checked that all my configurations in the main project are pointing to bin\subdir\ and that none of the other projects are pointing to the bin-folder.
How do I tell VS2010 to ONLY compile to bin\subdir\ and never touch bin\?
Edit: Just tried creating a blank web project, changing output path to a directory in the bin-folder, adding a project to the solution, referencing it and then I compiled: dll's for the referenced project wind up in both bin and the directory from output path. Could this be a VS2010 bug?
Quick fix: Put the files from your bin folder in another folder and put this in your post build event:
del /q "$(ProjectDir)bin\*"
copy "$(ProjectDir)..\lib\Sitecore Bin" "$(ProjectDir)bin"
It's fixed in Visual Studio 2012.

External Dlls not getting dropped by TFS

We have a shared build server running TFS2010. We use VS2008 solution(soon planning to upgrade to VS2010) at the moment.
Our ASP.NET 3.5 solution has some external dlls which are placed in our solution's 'Library' folder. Problem is that if we publish the site from our development machine, the the published folder is perfect. But when TFS builds it on the build server, then there are 3 external dlls which never get dropped and we have to manually copy them post build.
We tried a few things but it did not fix the issue. We have also double checked that like other dlls, these 3 dll have the correct refresh files placed in the bin folder.
One problem may be that a few of these problematic dlls may be on the GAC of development machine. If that really is an issue, then on the build server anyway we cannot put dll in the GAC.
Any ideas how we can force these 3 dll to get dropped in the bin folder correctly by TFS?
If you deploy/copy an application that contains a reference to a custom component that is registered in the GAC, the component will not be deployed/copied with the application, regardless of the Copy Local setting. See MSDN
You have to force copy local to true by adding Private metadata to the GAC assembly reference. Edit your project file and add Private metadata:
<Reference ..>
<Private>True</Private>
</Reference ..>
<ProjectReference ..>
<Private>True</Private>
</ProjectReference ..>
Now your GAC assembly should be copied/dropped from the output folder.
Did you try selecting the dlls from the "References" folder in the Visual Studio solution, then setting Copy Local to true from the properties panel?
Try examining the build log and check if msbuild was able to locate the dll's when building. You can select diagnostic logging when queuing up the build to get even more detailed logs.

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.

Referenced Assemblies in Web Site

Am I correct in assuming that I always need to explicitly deploy referenced assemblies when their source changes?
Yes you do. If you use the publish command in Visual Studios, it will include all the assemblies you need in the folder you selected to publish your site.
If a .dll has changed and you need to update your site, you can just publish again or copy the .dll.

Resources