Skip to content

Commit e0ec7a9

Browse files
authored
Merge pull request #1012 from PHeonix25/master
Fixes formatting for Visual Studio Packaging docs
2 parents b493d57 + b62fb9d commit e0ec7a9

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

docs/using/visual-studio-packaging.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ Squirrel packaging can be easily integrated directly into your build process usi
1010
The first step is to define a build target in your `.csproj` file.
1111

1212
```xml
13-
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release'"> <GetAssemblyIdentity AssemblyFiles="$(TargetPath)"> <Output TaskParameter="Assemblies" ItemName="myAssemblyInfo"/> </GetAssemblyIdentity> <Exec Command="nuget pack MyApp.nuspec -Version %(myAssemblyInfo.Version) -Properties Configuration=Release -OutputDirectory $(OutDir) -BasePath $(OutDir)" /> <Exec Command="squirrel --releasify $(OutDir)MyApp.%(myAssemblyInfo.Version).nupkg" /></Target>
13+
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release'">
14+
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
15+
<Output TaskParameter="Assemblies" ItemName="myAssemblyInfo"/>
16+
</GetAssemblyIdentity>
17+
<Exec Command="nuget pack MyApp.nuspec -Version %(myAssemblyInfo.Version) -Properties Configuration=Release -OutputDirectory $(OutDir) -BasePath $(OutDir)" />
18+
<Exec Command="squirrel --releasify $(OutDir)MyApp.%(myAssemblyInfo.Version).nupkg" />
19+
</Target>
1420
```
1521

1622
This will generate a NuGet package from .nuspec file setting version from AssemblyInfo.cs and place it in OutDir (by default bin\Release). Then it will generate release files from it.
@@ -20,7 +26,23 @@ This will generate a NuGet package from .nuspec file setting version from Assemb
2026
Here is an example `MyApp.nuspec` file for the above build target example.
2127

2228
```xml
23-
<?xml version="1.0" encoding="utf-8"?><package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MyApp</id> <!-- version will be replaced by MSBuild --> <version>0.0.0.0</version> <title>title</title> <authors>authors</authors> <description>description</description> <requireLicenseAcceptance>false</requireLicenseAcceptance> <copyright>Copyright 2016</copyright> <dependencies /> </metadata> <files> <file src="*.*" target="lib\net45\" exclude="*.pdb;*.nupkg;*.vshost.*"/> </files></package>
29+
<?xml version="1.0" encoding="utf-8"?>
30+
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
31+
<metadata>
32+
<id>MyApp</id>
33+
<!-- version will be replaced by MSBuild -->
34+
<version>0.0.0.0</version>
35+
<title>title</title>
36+
<authors>authors</authors>
37+
<description>description</description>
38+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
39+
<copyright>Copyright 2016</copyright>
40+
<dependencies />
41+
</metadata>
42+
<files>
43+
<file src="*.*" target="lib\net45\" exclude="*.pdb;*.nupkg;*.vshost.*"/>
44+
</files>
45+
</package>
2446
```
2547

2648
## Additional Notes
@@ -29,9 +51,10 @@ Please be aware of the following when using this solution:
2951

3052
* Solution needs to have nuget.exe available which can be accomplished by installing `NuGet.CommandLine` package in your solution.
3153

32-
~~~pm
54+
```pm
3355
PM> Install-Package NuGet.CommandLine
34-
~~~
56+
```
57+
3558
* It suffers from a bug when sometimes NuGet packages are not loaded properly and throws nuget/squirrel is not recogized (9009) errors.
3659
**Tip:** In this case you may simply need to restart Visual Studio so the Package Manager Console will have loaded all the package tools
3760
* If you get the following error you may need add the full path to squirrel.exe in the build target `Exec Command` call. `'squirrel' is not recognized as an internal or external command`

0 commit comments

Comments
 (0)