Visual Studio Hosting Process locks my files - visual-studio-2010

On every build, I copy a few managed and unmanaged libraries to my $(TargetDir)libs\ folder. However, since I'm referencing one of the managed dlls in Visual Studio, somehow the Visual Studio Hosting Process (vshost.exe) locks the file, resulting in a exit code 1 from copy.
What can I do about this?

You can disable the hosting process from project properties. It's in the Debug tab, as below:

Related

Code Changes in visual studio are not taking place when deployed on IIS

I have cloned a .net web application to Visual Studio 2017.I have made some changes to source file in a project and cleaned and built it. my solution file has 52 projects and all the projects will build without any error. Once I deploy it in IIS server and attach the process to visual studio, it hits the breakpoint but runs the old code itself.
Any help will be appreciated as this is delaying the work!!!!

Prevent Visual Studio 2010 MPI cluster debugger from copying all project binaries to temporary user folder before each execution

When using Visual Studio 2008 under MPI cluster debugger, each execution is launched without moving the generated binaries (.exe, .lib).
When using Visual Studio 2010 under MPI cluster debugger, each execution is launched by moving the generated binaries (.exe, .lib) in two directories :
- all the .lib are first copied inside the .exe directory
- once done, all the .exe directory is copied inside a temporary directory containing by default the user login name.
So with Visual Studio 2008, each execution of a medium size C++ project takes a few seconds to be launched.
With Visual Studio 2010, each execution of a medium size C++ project takes several minutes.
Is there a way to change the behaviour of Visual Studio 2010 in order to work like Visual Studio 2008 did ?
Or if not possible, is there a way to improve the launching time of each execution ?
I am using MPICH2 for MPI and execute my project only locally (localhost/2 environment with -localonly mpiexec argument), for Visual Studio 2008 and Visual Studio 2010.
Thanks for any help.
Do review the MSDN page that describes the MPI debugger configuration. Note how the descriptions of the Deployment Directory and Working Directory properties describe what you see.
However, you are not actually debugging on a cluster so you don't need to have these copies made. Without otherwise knowing what your config looks like, or any way to test it, I'd guess that you have these properties set wrong. As documented on the page, for local debugging you should select:
Deployment Directory: none
Working Directory: the output directory of your project.
Which should avoid the copying.

Copy/Move Visual Studio Projects/Solutions To Another Computer

So I have a handful of Visual Studio projects that I need to move to another computer. Is it as simple as a copy and paste or will that mess something up? Both machines will have the same version of Visual Studio installed, so that shouldn't be an issue.
Is there an export function that I've overlooked?
If the Visual Studio version is the same, you can just copy the project folder.
Till the time you are moving your solution file and associated files you should be good.
In case you are using any source control update your solution from there.
Hope you have the same VS version and any addon frameworks you have
You can directly copy the project to the projects folder. This worked perfectly for Visual C++ projects for me (and also some other projects). But when I copied my Cordova App from one PC to the other (Both had Visual Studio 2015), I wasn't able to open the project. Whenever I tried to open the project, trying both the ways - directly from the Project file and the open option in Visual Studio, it at first opened but when I tried to open a file, it just got hung and didn't respond.
This problem may occur because Cordova apps have some configuration files that might be different for different PCs. I am not sure that this is the reason for the problem.
A solution that I used was that I created a new Project and copied the files to the project folders (excluding the configuration files).
Can you save the file to cloud? if so then you could potentially upload the file to cloud and download the file to the new

Add reference deselected in visual studio 2010

I am trying to open a existing project in visual studio 2010 using
new->project from existing code
and selecting visual c# as the language. When I run it, I get errors. Later I heard from the person who created the project that I have to add few references, which are present in the references folder in the project itself. It comes in the side window - solution explorer.
However, when I right click on that folder to add as references, that option is 'greyed', or disabled. How Can I correct this?
The DLLs named freeglut.dll and glut32.dll are not COM or NET components. You cannot add them as references to your project (You have 4 solutions in your archive, I have choosen the one named fwa_annimate but I think the problem is the same).
The DLL named Tao.FreeGlut.dll needs these files in the same directory where you application run to work. So the easiest way to resolve your problem is to select the two DLLs inside Visual Studio and change the property Copy to Output Directory from Copy Never to Copy Always.
In this way, when you start to debug your app, the VS IDE will copy the two files to the BIN\DEBUG or BIN\RELEASE directory where you app runs when launched inside the VS IDE.
Of course, you need to deploy all these file when you distribute your application.
(By the way, I have no idea what is supposed to do)

SharePoint development in visual studio without having to deploy/debug on every code changes

I'm using VS2010 connected to a local SP2010 installation, I edit the code in VS2010 (i.e. of a WebPart) and then in order to see the result on a browser I deploy the solution.
This is very annoying since it is a big project and it takes a couple of mins to deploy the solution.
I was wondering if it is possible to have the "edit -> save -> F5" approach even for SharePoint.
Thanks!
I'm gonna to integrate here the answer i get from the kind ppl and what i've actually done to solve/mitigate my slowness problem:
Installed CKSDev Visual Studio plugin from here: http://cksdev.codeplex.com/
On the SharePoint project properties tab set to 'True' the property 'Auto copy to SharePoint root', with that on each time you do save a 'visual' (ascx, aspx, js, css, ..) source file, it will be automatically copied over the SP hive without having to manually push it using the Quick Depl. option
On SharePoint project properties page (right-click, properties), add the following post build event command line:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\gacutil.exe" /i "$(TargetPath)"
iisreset
The previous commands will:
Install the project dlls into the GAC
Restart IIS in order to catch the new dlls
Now each time you do save a change in the visual or build the code it will automatically pushed to the SP installation.
For newer source files i still need to normally deploy the project.
You can do that by copying the modified file to the corresponding folder inside SharePoint Hive[14] (Or you can edit it there directly), and recycle the application pool.
Note that it this solution is only applicable to web parts, pages and xml files and it cannot be done for code files.
If you have modified your code files you have to recompile them and copy the dlls to GAC[%systemroot%\assembly] or BIN[14\bin] folder depending on your settings.
Download CKS: Development Tools Edition (aka CKSDev) from here and install into VS 2010. You will see new context menu "Quick Deploy" in solution manager which will speed up requested tasks: deploy to GAC/BIN, Recycle App Pool and more (shortcuts are accessible!). Very handy tool.
Use CKSDev, and separate your solution into smaller solutions so you can work on a subset of your projects, I would be very surprised if your webpart is dependent on every project in your master solution. If you are developing on a virtual machine without internet access also ensure that you are not waiting for timeout on your certification checks everytime you recycle the apppool (happens when you deploy). Read here for how to: http://joelblogs.co.uk/2011/09/20/certificate-revocation-list-check-and-sharepoint-2010-without-an-internet-connection/
I am going though below step during debug code.
1) if you are changes only code assembly than Build Your Project after changes code.
2) Open Assembly folder(run > assembly) and drag and drop your project's dll(will be found it out from Your Project Directory\bin\Debug).
3) open IIS (run > inetmgr) and goto Application Pools and find it out your sharepoint we-app's Pool. after selecting Application Pool (Recycle) it.
4) now come back on VS SharePoint Project.Debug > Attach to Process > w3wp.exe.
should be hit your break point.
that's it.

Resources