2016-09-26 4 views
0

프레임 워크 타겟이 4.61 인 VS 2015, .Net Core MVC 용 Nuget 패키지를 만들었습니다.내 Nuget 패키지가 정적 컨텐츠에서 병합되지 않습니다

내 nuspec은 다음과 같습니다

<?xml version="1.0"?> 
<package > 
    <metadata> 
    <id>MyThing</id> 
    <version>0.9.5</version> 
    <authors>Me</authors> 
    <owners>Us</owners> 
    <requireLicenseAcceptance>false</requireLicenseAcceptance> 
    <description>This should merge in this content, but doesn't</description> 
    <releaseNotes></releaseNotes> 
    <copyright>Copyright 2016</copyright> 
    <tags>Core MVC</tags> 
    <dependencies> 
     <dependency id="Microsoft.AspNetCore.Diagnostics" version= "1.0.0"/> 
     <dependency id="Microsoft.AspNetCore.Mvc" version= "1.0.0"/> 
     <dependency id="Microsoft.AspNetCore.Server.IISIntegration" version= "1.0.0"/> 
     <dependency id="Microsoft.AspNetCore.Server.Kestrel" version= "1.0.0"/> 
     <dependency id="Microsoft.AspNetCore.StaticFiles" version= "1.0.0"/> 
     <dependency id="Microsoft.Extensions.Configuration.EnvironmentVariables" version= "1.0.0"/> 
     <dependency id="Microsoft.Extensions.Configuration.Json" version= "1.0.0"/> 
     <dependency id="Microsoft.Extensions.Logging" version= "1.0.0"/> 
     <dependency id="Microsoft.Extensions.Logging.Console" version= "1.0.0"/> 
     <dependency id="Microsoft.Extensions.Logging.Debug" version= "1.0.0"/> 
     <dependency id="Microsoft.Extensions.Options.ConfigurationExtensions" version= "1.0.0"/> 
     <dependency id="Microsoft.VisualStudio.Web.BrowserLink.Loader" version= "14.0.0"/> 
     <dependency id="xunit" version= "2.1.0"/> 
     <dependency id="xunit.runner.console" version= "2.1.0"/> 
     <dependency id="xunit.runner.visualstudio" version= "2.1.0"/> 
     <!--dependency id="dotnet-test-xunit" version= "1.0.0-rc2-build10025"/--> 
    </dependencies> 
    <contentFiles> 
     <!-- Include Assets as Content --> 
     <files include="**/wwwroot/**/*.*" buildAction="EmbeddedResource" /> 
     <files include="**/Controllers/*.*" copyToOutput="true" /> 
     <files include="**/Model/*.*" buildAction="None" /> 
     <files include="**/Views/*.*" buildAction="None" copyToOutput="true" /> 
     <files include="**/Views/**/*.*" buildAction="EmbeddedResource" copyToOutput="true" /> 
    </contentFiles> 
    </metadata> 
</package> 

의 다양한 매개 변수가 그들 중 누구도 작동하지 입증 할 수 있습니다 포함되어 있습니다. 파일은 추가 된 프로젝트에 복사되지 않지만 누젠 패키지 캐시에 있습니다.

+0

대상 프로젝트가 project.json 파일에 의해 관리됩니다 :에

참조하십시오? 이것이 NuGet contentFiles를 지원하는 유일한 프로젝트 유형입니다. –

+0

예, project.json이있는 VS 2015 Update 3 핵심 사이트입니다. –

답변

0

동일한 .nuspec 파일 콘텐츠를 사용할 때 동일한 문제가 발생합니다. nupkg 파일의 압축을 풀어 패키지를 확인한 후 <contentFiles> 태그에 나열된 모든 파일이 패키지에 성공적으로 들어 있습니다. 그러나 파일은 패키지가 설치된 프로젝트에 설치되지 않습니다.

파일이 프로젝트 구조에 표시되지는 않지만 콘텐츠 파일은 예상대로 작동합니다. 예를 들어 .cs 파일을 <contentsFiles>에 저장하면 패키지를 설치 한 후이 .cs 파일의 클래스와 멤버를 사용할 수 있습니다. 이 NuGet 3.3+: contentFiles not added to project

관련 문제