How to Generate a proxy class in a specific project by using svcutil.exe? - wcf

By default svcutil.exe generates proxy class and its .config in C:\Program Files\Microsoft Visual Studio 9.0\VC.
What is syntax for generating a proxy class in a specific project by using svcutil.exe ?

Use the /directory option.
To quote directly from the help which is displayed when you type svcutil /? :
/directory:<directory> - Directory to create files in (default: current directory) (Short Form: /d)
Just to elaborate a little more... svcutil just generates the files, it doesn't manipulate the .proj file to add a file to the project, you have to do that yourself. What you might want to do is:
show all files in the Solution Explorer, then refresh the folder containing the generated files, then select them all and add them to the project (you should remove the existing files before doing a manual generation)
write a little batch script or command line app that iterates the folder the files are created in and inserts entries for them into the .proj file.
if possible use the Add Service Reference option from the context menu in the Solution Explorer, that generates the files and adds them to the project for you

Related

How to create a pkpass file in Visual Studio, in widows

I wonder if there is a way to create a pkpass file in windows from visual studio, or is there a way to generate its structure and change the information for testing?
I've been looking at how to make this structure manually, but I have no idea.
Create a new project in Visual Studio and choose the type of project
you want to create. Download the pasKit framework from Apple's
developer website.
Add the PassKit framework to your project by right-clicking on the
project in the Solution Explorer and selecting "Add Reference". In
the Reference Manager dialog box, browse to the location where you
downloaded the Pass-Kit framework and add it to your project.
Create the pkpass file structure by creating a new directory with
the ext (.pkpass) This dir will contain the files and folders that
make up the pkpass file.
Write the necessary code to generate the contents of the pkpass
file, such as the pass.json file, imgs, and other rsrcs. You can use
the PassKit classes to create the pass.json file and add the
required fields, such as the pass type identifier, serial number,
and authentication token.
Once you have created the files and folders, compress them into a
zip file. Rename the this zip file with extension".pkpass" to create
the final file.
To test the pkpass file, add it to the Passbook app on whatever
iphone you have

Move application extensions located in Debug folder to one folder

I have a WinForms application that uses 3 .dll Application Extensions. Two of them come from the KBCsv csv file parser extension, and the third is the MySQL Data extension.
Currently these files are automatically stored in the project's Debug folder along with the application itself. When I move the application to an external location, I have to keep these extensions in the same folder as the application or I get an error like:
Could not load file or assembly 'KBCsv, Version....' or one of its dependencies. The system cannot find the file specified.
It would tidy up the desired folder that the application is to be located in if I could store these extensions in one folder, inside that folder. Any guidance as to how I could achieve this would be greatly appreciated.

Visual Studio ASP.NET Web API Precompiled files placed in a different folder with TFS

I have an asp.net web api project whose output needs to be packaged in a setup project using wix.
I would like to precompile the site. The problem is that the precompilation process generates variable file names (ie. *.compiled files in particular).
I also would like to build the setup in a TFS build.
It seems that my only option is to generate a .wxs file wihtin the prebuild step of the wix project.
The .wxs files source paths are using $(var._My_Web_Project_.TargetDir). This seems to be translated to a Sources based directory.
I'm using paraffin to do that already and it works perfectly fine when building the solution with visual studio.
When building the solution through a TFS build, the .compiled files are copied to a Binaries folder, whereas all the other related web site files are copied to a Sources based directory.
The build errors are like the following :
The system cannot find the file 'd:\BuildAgents\___basedir___\Binaries\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'.
The file is indeed in the Sources directory.
'd:\BuildAgents\___basedir___\Sources\___web_project_dir\_PublishedWebSites\___site___\bin\textsample.cshtml.c6fb271c.compiled'
I think I somehow need to redefine the aspnet_compiler output or something like this, but can't figure out how to do that.
The msbuild command line arguments are the follwing:
/p:GenerateProjectSpecificOutputFolder=true /p:VisualStudioVersion=14.0 /p:DeployOnBuild=true /p:PublishProfile=local /p:CleanWebProjectOutputDir=False /verbosity:d
EDIT 1: I'm using XAML build.
Any help appreciated.
EDIT 2:
With the new task based build, it works as is (no need to use an additional Copy Files task).
The aspnet_compiler output the .compiled files in the correct folder :
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project\obj\Release\AspnetCompileMerge\Source -c D:\BuildAgents\vNext\_work\1\s\Softs\__Solution__\__Web_Project__\obj\Release\AspnetCompileMerge\TempBuildDir
In the new tasks based build system, it's easy to copy files from a source folder to a target folder with Copy Files task.
Source Folder: Folder that contains the files you want to copy.
Contents: Specify minimatch pattern filters (one on each line) that you want to apply to the list of files to be copied.
Target Folder: Folder where the files will be copied. In most cases you specify this folder using a variable.

MSBuild - Nest an external file (file outside of the project folder) into a file in the project folder

I have the following scenario:
I have 2 projects:
Proj1
Proj2
Each of these projects needs access to a similar service (FooService) so I wrote up the Foo.svc and Foo.svc.cs files and put them in a directory that was outside of both of the project directories.
I then edited my Proj1.csproj file to do the following:
Foo.svc
This works fine in terms of editing and compiling the code, however I can't access the service: http://localhost/Proj1/Foo.svc << This does not exist (because the actual Foo.svc file is not in the Project directory).
So instead I copied the Foo.svc file inside each of the Projects and just left the code-behind file (Foo.svc.cs) in the common directory. However, now Visual Studio complains that "The parent file, 'Foo.svc', for file '..\Common\Foo.svc.cs' cannot be found in the project file. Probably because it is looking for the 'Foo.svc' file relative to the code-behind file?
Foo.svc
Is there any way to do what I'm looking for... keeping the code-behind outside of both project directories (so they can both link to it) and somehow have svc files that are accessible in my IIS on localhost and have it so that the code-behind file folds into the svc file in Visual Studio?
What you're talking about is altering your MSBuild file (also known as a csproj file - http://msdn.microsoft.com/en-us/library/bb629388.aspx)
I tried to simulate what you're doing and I don't think there is a solution that would fit what you want. You're right, your project will work just fine, but aesthetically you can't have a file external to the project directory nested to a file inside of the project directory.

Build VC++ project with additional cpp file using MSBuild

I need to build VC++ project (made in VS2008) from command line using MSBuild with additional .cpp file which isn't part of this project (doesn't listed in section of .vcproj file.
Is there are any way to do this? (e.g. just by passing filename to command line input).
Editing .vcproj file by my script is also is a option but I save it for a worst scenario when there are no way to do it just with MSBuild.
I don't think you can point MSBuild at a project file and tell it to build this project and add another file at the same time. I'd either update the .vcproj file to include the file you're trying to add or go for the script-driven editing approach. Actually, I'd probably just change the .vcproj file as I'd think this is the safer approach and less likely to break something.
You can add the file to the project if it's in the same directory.
If it's shared / in another directory you can try adding as a link.
In the Add / Existing Dialog notice the Arrow on the edge of the add button. Try clicking it.