VS 2010 Beta2 Integration Project Exp hive output? - visual-studio-2010

I am in the process of upgrading an existing VS Integration Project to 2010 Beta2. The project uses Spring. The Initialize() code in the VSPkg.cs includes a call that tries to access an XML file that contains some context settings. The xml file properties are set to the Build Action = Content and Copy to Output Directory = Copy always. The file indeed appears in the output directory (bin\Debug). BUT, by some default the build output also ends up in the Documents and Settings\\Local Settings\Application Data\Microsoft\VisualStudio\10.0Exp\Extensions\\\. The contents of this directory is apparently used to initialize the Experimental Hive when I try to debug. The problem is that only the dll files, pkgdef file and vsixmanifest get copied there. How can I make my XML file to be copied there as well? Since it is not there I get an IO exception "Can't find file..." during the Initialize().

Have you tried a post-build action?

Related

Prevent Visual Studio from deleting output files from referenced projects

I've got a Class Library project and a Console project. Inside the Class Library project there's a folder called "ConfigSettings" containing a configuration file that's referenced by the App.config file. Its "Copy to Output Directory" is set to "Copy Always".
The Console project references this Class Library project. When the console project is built, the ConfigSettings folder is created in the correct place along with the external config file. However, every time I Debug the Console project, the external config file is deleted. The ConfigSettings folder however is left untouched. If I mark the file as read-only it is not deleted, and warning appears in Visual Studio's Error List:
Warning Unable to delete file "C:\<path>\<app>\bin\Debug\ConfigSettings\settings.config". Access to the path 'C:\<path>\<app>\bin\Debug\ConfigSettings\settings.config' is denied.
Is there a setting I can change that will prevent VS from removing this file when I Debug the project? I am using Visual Studio 2015.
This might not be the best solution possible, but I found here, if you do a "Clean solution" just before executing your solution, the files will remain.

web deployment package (.zip file) not created in Visual Studio 2013

I am trying to create a deployment package in Visual Studio 2013. I have specified that the package should be placed at C:\Deployment\bin\WebSite.zip - the absolutely simplest location. All the project files build but the publish fails with this error:
Transformed Web.config using C:\Services\IdentityServer\Thinktecture.IdentityServer.v2\src\OnPremise\WebSite\Web.Siloed.config into obj\Siloed\TransformWebConfig\transformed\Web.config.
Auto ConnectionString Transformed Areas\Admin\Views\Web.config into obj\Siloed\CSAutoParameterize\transformed\Areas\Admin\Views\Web.config.
Auto ConnectionString Transformed Views\Web.config into obj\Siloed\CSAutoParameterize\transformed\Views\Web.config.
Auto ConnectionString Transformed obj\Siloed\TransformWebConfig\transformed\Web.config into obj\Siloed\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Siloed\Package\PackageTmp.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(2584,5): Error : Copying file ..\..\..\Deployment\bin\um.zip to obj\Siloed\Package\PackageTmp\.ebextensions\um.zip failed. Could not find a part of the path '..\..\..\Deployment\bin\um.zip'.
I have no idea where this path '......\Deployment\bin\um.zip' is coming from. I specified that the deployment package should be created at C:\Deployment\bin\WebSite.zip, not um.zip.
So, I checked out C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(2584,5) and the code looks like this:
<!--Force Copy Of all file to the $(WPPAllFilesInSingleFolder) if needed-->
<CopyPipelineFiles PipelineItems="#(FilesForPackagingFromProject)"
SourceDirectory="$(WebPublishPipelineProjectDirectory)"
TargetDirectory="$(WPPAllFilesInSingleFolder)"
SkipMetadataExcludeTrueItems="True"
UpdateItemSpec="True"
DeleteItemsMarkAsExcludeTrue ="True"
Condition="'#(FilesForPackagingFromProject)' != ''">
<Output TaskParameter="ResultPipelineItems" ItemName="_FilesForPackagingFromProjectTempory"/>
</CopyPipelineFile>
I have tried editing the "PipelineItems" and "SourceDirectory" and have even hardcoded them. But the same message, "Could not find part of the path....", is being displayed every time I run the Publishing. The "Could not find part of the path...." points to the new paths I specified in "PipelineItems" and "SourceDirectory. The .zip file never seems to get created anywhere. I have seached my entire computer for um.zip and WebSite.zip with not luck.
Any help would be greatly appreciated as I am completely out of ideas.
Turns out this um.zip is somehow part of build but it is not getting created. Anyway, I was lucky enough to find a previous deployment package that was generated and I just manually built the new deployment package based off the old one. Deployed fine so I guess that is how I will proceed.

Including a batch file with VSIX

I'm trying to create a Visual Studio plugin, it's a menu item that executes batch files. I have no idea how to include the batch files (or any other additional files) with the VSIX when publishing so that they are available to all users that install the extension.
In solution explorer right click on the batch file (in this case I called it BatchFile.cmd) and choose 'Properties'
In the properties window change:
Build Action: Content
Include in VSIX: True
When the solution is built in release mode it creates a VSIX file in the bin/Release folder. This is the package and it contains all the assets required. When the package is installed on another machine, the batch file is included in the install location and can be referenced using:
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "BatchFile.cmd"
You can just include the batch file as content in your project, and use GetAssembly() to find the location of your adin dll at runtime

How to automatically copy files in building project with Visual Studio

I have some custom made XML files and a read me file that I've included in my project.
How do I make it so that these files are copied to my debug/release folders automatically when I build my project? I've tried setting the Copy to Output Directory property to "Copy Always" but this doesn't seem to do the trick.
I'm using VS2010
I've found the answer. The build action needs to be set to Content if you want to just directly copy the file to the output folder.

Deploying a Content File *Link* for a VS2008 Website project

I have added an Xml configuration file to a web project in VS2008 using the “Add as Link” option on the “Add Existing Item” dialog. The Xml file is common to a number of other web projects within the solution so it exists in the Solution level directory. I have used the file link functionality to avoid a unique copy being added to each web project.
SolutionFolder
SharedConfigSettings.config
WebProject1Folder
WebProject2Folder
Problem
The problem is that the linked file is not deployed. I need the file to be copied to the root of the web application so that it is in the same location as the web.config file.
I have tried
1) Setting the file properties on the link as...
Build Action: Content
Copy to Output Directory: Do not copy
...results in the file not being copied at all
2) Setting the file properties on the link as...
Build Action: Content
Copy to Output Directory: Copy always
...results in the file being copied to the Bin directory below the web application root.
3) Post build event to copy the file. This works but is messy to implement because it requires additional steps to get this to work on the build server.
Is there a way that this can be done using the standard options available in the project file?

Resources