Visual Studio is creating a \bin folder and copying various assemblies into it when I open a web application solution, even before I compile
What is triggering this action?
And how do I control it?
Reason I'm questioning the process, is the assemblies are not the expected ones
This is where Visual Studio puts all the dlls for runtime for your project. Library dependencies that the project needs. All the dlls that Visual Studio needs for a web project are kept here as well as other packages from Nuget that you might add, and your own. If you look in the References section in the Web Project, you will see many of the dlls that appear in the bin directory.
If there are some assemblies there that you do not want. You can try removing the reference from the Reference folder. Right click on the library in the Reference folder and select remove.
Be careful with removing references though, because your project may need it to function.
Related
I have an ASP.NET MVC project with one solution and 52 projects in the same solution. As you know, It takes long time to build whole solution. So I decided to unload some of the projects until there is some change or sprint task in the code in the unloaded project. However we are a team and use TFS version control and we need to use update unloaded assembly. So I have a build server that makes me sure whenever somebody starts to check-in (for example -> C:\bin in our network) the last version of all assembly can be found there.
I added C:\bin path as Reference Path to the UI Project (main project of the solution) of the solution and I expect when some projects is unloaded the reference comes to visual studio from the build server path (C:\bin) otherwise the reference of the project comes to Visual Studio from the nested project (not from build server).
But the reference can not be found when the project is unloaded:
And my Build server contains the assembly:
Finally I found a way (only in Visual Studio 2019) to unload projects and however use updated class library of unloaded projects. And thanks to Hooman Bahreini for his idea of using two separated solutions.
The way is that, there is a feature of Visual Studio 2019 that we can Save As Solution Filter which is in .slnf extensions. So I can unload some of my projects and check-in .slnf file via my source control (like tfs). So I have two solutions Now, one is .sln which is contains all of projects and the other one is .slnf which is unloaded some of projects in it.
The things can we do is that whenever I want to get my project I have to use .sln file and builds that and then close the file and then open the .slnf file (I'm sure that I have updated class library of unloaded projects) and do my task and check-in my changes.
I have a .NET Web Application, and I include some 3rd party references in a folder called references. That folder is in the same directory as the Visual Studios solution, but not the same directory as the Project File. Now, when I first create this project, add my references, and build - everything works perfectly. However - once I check in to TFS and then try pulling down the code, the references cannot be found. They still exist in the "references" folder that I created, but they are not showing up in the bin folder. Any suggestions on what I can do to fix this? I'm using Visual Studios 2012.
When you checkin to TFS, make sure you checkin those DLLs. By default, TFS excludes binary files during checkin.
Also, if those 3rd party Dlls are hosted on Nuget, then use Nuget packages to add/manage references. That way, you do not have to bother checkin them into TFS. You can simply enable Nuget's package restore on build (right click on Solution -> Enable Nuget Package Restore). More info here.
I'm having an issue adding a reference to my C# project. I need to add a dll called PhpNetCore. I have located this DLL with Windows Explorer in Assembly\GAC_MSIL\PhpNetCore. However, when I browse with the Visual Studio explorer to add a reference to the DLL it doesn't show up. They are simply not visible. What gives?
Using Windows Explorer, I copied the PhpNetCore folder to my desktop. I was then able to add a reference without any issues.
Thanks in advance for any help.
-Geoff
That's "as designed" for Visual Studio. The GAC is for publishers to share assemblies with multiple applications. Publishers can share assemblies with developers in Common Files\Reference Assemblies.
The ideal method of adding a reference to your project is to use the NuGet package manager.
If neither of those are available, copying is okay, too.
I am not sure about that library but I found a way to use it installation free if this is of any help.
Installation-Free Phalanger
I have a Visual Studio 2010 solution that contains 3 projects: a dll project, an executable project, and the Installer project.
I am working on the dll and the executable concurrently. The executable is simply a front end for the library. While developing the two in Visual Studio I simply added a reference to the dll project from within the executable and it works fine.
What I'm having trouble with is the deployment. Ideally the dll would be compiled and installed in a subdirectory of the executable. Using the "Visual Studio Installer - Setup Wizard" project template for my installer doesn't seem to be giving me the options I need.
Am I going about this wrong by developing my backend and frontend in different projects? What steps should I take to deploy the compiled dll along with the executable? I may be going about this all wrong, so please help me understand a better methodology if this seems backwards. For all the programming I learned in college, no one ever went over what I do when I actually want to deploy my software.
Since the DLL project is explicitly referenced from the EXE project, it is automatically copied in the EXE's build folder (i.e. bin\Debug or bin\Release) and is considered part of EXE project's "primary output". As a consequence, you only need to reference the EXE from your setup project.
The installed DLL will be in the same folder as EXE. Why would you want to install the DLL in a different folder on the user's machine if it is not there on the development machine? If you are loading it dynamically and using reflection, then don't reference it from EXE, but do reference it from the setup project, which then gives you the power to set whatever target folder you want.
This is what you need to do.
On your Solution create new Project > Other project Types > Click Setup and Deployment
On The Application Folder > right click > Then Add your front end Application > Build.
Check this
Regards
I have a DLL I need to deploy with my C# application. It's not currently included in the installation package when I hit "Publish" so how do I include it?
Would the process be any different if I had app.config and other files I wanted to deploy with my application?
If it's referenced it should be included automatically. I've deployed a couple of apps that require a 3rd party dll and they've published OK.
Is the dll referenced correctly in your project? That's the only thing I can think of at the moment that might be the problem, but if it wasn't your code wouldn't compile and/or link anyway.
To get the xls file to deploy all you need to do is add the file to the solution and then set the "Copy to Output Directory" property on the file.
I take it you are using Visual Studio?
If your using Visual Studio 2008 (I have no experience with Visual Studio 2005) under the Publish tab in your project properties click on the Application Files button. This will bring up a list of all dependencies assembalies required by your project. If you find that required dll is not being published by the Visual Studio publisher tool by default you can go into here and set the Publish Status of the offending dll to Include.
Sometimes in my more complicated projects, depending on the type of dependency, I have to go into this menu and force certain dll's to be included opposed to the default Prerequsite setting.
...but this is all under the assumption you have the assembly properly referenced in the required projects and everything is compiling fine.
Can't you add the dll as a resource to your installer project?