2015-04-14 13 views
6

Nuget paketinin web.config dosyasını web.config.transform'a projemde yeniden adlandırma sorunu var. Ben onun yanında bir nuspec dosyası ile csproj dosyası kullanıyorum ve nuset dosya yeniden adlandırmak, ancak çıktı ve nupkg dosyasında, web.config web.config için yeniden adlandırılır nuspec dosyasında hiçbir satır yoktur. dönüşümü.nuget pack web.config dosyasını web.config.transform olarak yeniden adlandırıyor

web.config sadece (normal olarak, bu oluşturma işlemi tarafından oluşturulan oluyor) nuspec dosyası tarafından eklediği bu yapıyor neden

kimse önerebilir, projenin bir parçası değildir - bu gibi bana geliyor nuget bir hata, ama belki de nuget yeniden adlandırmak için bir talimat olarak alıyor csproj dosyasında bir şey var mı? Bu ne olabilir?

komut:

nuget pack path\to\projectfile\myproject.csproj -OutputDirectory C:\temp\publish -Version 1.1.646.32517 -Exclude Template.config -Exclude Template.Debug.config -Exclude Template.Release.config -Verbosity detailed 

çıkışı:

Attempting to build package from 'myproject.csproj'. 
Packing files from 'path\to\projectfile\bin'. 
Using 'myproject.nuspec' for metadata. 
Add file 'path\to\projectfile\bin\myproject.dll' to package as 'lib\net451\myproject.dll' 
Add file ... to package as ... 
... 
Found packages.config. Using packages listed as dependencies 
Id: myproject 
Version: 1.1.646.32517 
Authors: xxx 
Description: myproject 
Dependencies: Microsoft.AspNet.WebApi (= 5.2.3) 

Added file 'content\ApiTestPage.html'. 
Added file ........ 
..... 
Added file 'content\Web.config.transform'. 
Added file 'lib\net451\myproject.dll'. 

Successfully created package 'C:\temp\publish\myproject.1.1.646.32517.nupkg'. 

nuspec dosyası: önceden

<?xml version="1.0"?> 
<package > 
    <metadata> 
    <id>$id$</id> 
    <version>$version$</version> 
    <title>$title$</title> 
    <authors>$author$</authors> 
    <owners>$author$</owners> 
    <description>$description$</description> 
    <requireLicenseAcceptance>false</requireLicenseAcceptance> 
    <releaseNotes>xxx release.</releaseNotes> 
    <copyright>Copyright xxx 2015</copyright> 
    </metadata> 
    <files> 
    <file src="bin\*.*" target="content\bin" /> 
    <file src="web.config" target="content" /> 
    </files> 
</package> 

Teşekkür

Chris

+0

Bunun için herhangi bir çözüm bulundu? – FiringSquadWitness

cevap

1

Aynı sorunu yaşıyorsanız, bunu nuspec dosyasına Web.config dosyasını açıkça ekleyerek çözdüm. Öncelikle bu konuyu lekeli zaman

<package > 
    <metadata> 
    ... 
    </metadata> 
    <files> 
    <file src="Web.config" target = ""/> 
    </files> 
</package> 

, ben de IIS artık yerine /content daha paketin kökünden yapıyordu fark ettim paketin kök içine içeriğimi hareket ettirerek (isteksizce) Bu çözüldü. Bu soruna sahip değilseniz, <file src="Web.config" target = "content"/> sizin için daha uygun olabilir.

Tamlık için, nuspec'in dosya bölümü (kök içeriğe taşınan içerik nedeniyle) şu şekildedir.

<files> 
    <file src="Web.config" target = ""/> 
    <file src="*.asmx" target = ""/> 
    <file src="*.asax" target = ""/> 
    <file src="*.html" target = ""/> 
    <file src="bin\*.dll" target="bin" /> 
    </files> 
+0

Maalesef bunu zaten yaptık ve hem "web.config" hem de "Web.config" 'i denedik ama ne bizim için çözdük. Nuget'in çıktı dosyasına bir dönüşüm dosyası koyması oldukça garip, bu yüzden benim tahminim proje dosyasında bir şey. – ChrisH

İlgili konular