nuspec approach to single package for both asp.net 4.0 and asp.net 4.5 projects

Topics: General
Jan 24, 2013 at 5:13 PM

i'm looking to author my nuspec so that i can maintain a single package that continues to support asp.net 4.0 project usage and adds support for asp.net 4.5 project usage.

Are the following contents, lib, dependencies and framework assemblies settings expected to enable that and work providing i'm building package, and users are installing it, using nuget 2.2 and newer?

\Contents\net40\web.config.transform
\Contents\net40\App_Code\SignInRequestResponseValidator.cs
\Contents\net45\web.config.transform
\Contents\net45\App_Code\SignInRequestResponseValidator.cs

\Lib\net40\MyNugetPackageNet40Assembly.dll
\Lib\net45\MyNugetPackageNet40Assembly.dll

<dependencies>
  <group targetFramework="net40">
    <dependency id="<some net40 package>" version="2.2.0.2" />
  </group>
  <group targetFramework="net45">
    <dependency id="<some net45 package>" version="1.2.6" />
  </group>
</dependencies>

<frameworkAssemblies>
  <frameworkAssembly assemblyName="<some net40 assembly>" targetFramework="net40" />
  <frameworkAssembly assemblyName="<some net45 assembly>" targetFramework="net45" />
</frameworkAssemblies>

Developer
Jan 24, 2013 at 5:25 PM

Your package structure looks good. It should work as you expect.

Jan 26, 2013 at 7:14 PM

Thanks for response. 

It seems that my internal company deployment of nuget gallery doesn't currently have the latest nuget.core in place and so attempts to publish packages to it that are using the new nuget 2.0+ dependencies/group settings support generates "Failed to read the package file" error message. 

Is it just the dependencies/group settings above that require nuget gallery deployment to be running the latest nuget.core bits or do the multi-target Content, Lib and frameworkAssemblies/frameworkAssembly[@targetFramework] settings also require it? 

In other words were those specific behaviors supported in nuget gallery installs using pre-nuget 2.0+ nuget.core installations?

Developer
Jan 27, 2013 at 3:58 PM

Only the multi-target Content and Tools also requires NuGet 2.1+

The multi-target Lib and frameworkAssemblies had been available before 2.0

Jan 27, 2013 at 9:07 PM

When you said Tools did you mean dependencies?  

If not does the multi-target dependencies support require NuGet 2.1+ and does this mean the Tools folder install/init/uninstall.ps1 scripts support multi-target folder settings as well?

Developer
Jan 28, 2013 at 12:57 AM

By TOols, I mean the install/init/uninstall.ps1 scripts.