2

I have a C# web app project which actually has no ASP.Net or C# in it. It's just a single html page with some Javascript, CSS, and a couple of images.

I want to use MSBuild to deploy a version of this app to an output folder with minified JS and CSS.

With the following code, I get an error "CSC: fatal error CS2008: No inputs specified." I'm guessing because the there is no actual C# code to compile but I'm not sure.

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
    <PropertyGroup>
        <CssTidy>..\build_tools\csstidy.exe</CssTidy>
    </PropertyGroup>

    <PropertyGroup>
        <DeploymentFolder>Test\</DeploymentFolder>
        <SourceProject>..\..\Test\Test.csproj</SourceProject>
    </PropertyGroup>

    <Import Project="Common.Web.targets" />

    <ItemGroup>
        <CssFiles Include="..\..\Test\CSS\stylesheet.css" />
        <ScriptFiles Include="..\..\Test\JavaScript\javascript.js"/>
    </ItemGroup>

    <Target Name="compress_css">
        <Attrib Files="%(CssFiles.FullPath)" ReadOnly="false"/>
        <Exec Command="$(CssTidy) %(CssFiles.FullPath) %(CssFiles.FullPath) --template=highest" />
    </Target>

    <Target Name="compress_js">
        <Attrib Files="%(ScriptFiles.FullPath)" ReadOnly="false"/>
        <JSCompress Files="%(ScriptFiles.FullPath)"></JSCompress>
    </Target>

    <Target Name="call_targets">
        <CallTarget Targets="compress_css"/>
        <CallTarget Targets="compress_js"/>
    </Target>
</Project> 

How can I accomplish this?

Carter
  • 2,850
  • 9
  • 44
  • 57
  • Does this help? http://stackoverflow.com/questions/986221/tfs-build-server-csc-fatal-error-cs2008-no-inputs-specified – KMoraz Nov 20 '09 at 10:43

4 Answers4

4

You could override the CoreCompile target and do nothing there:<Target name="CoreCompile" />. This will skip its activities and move on. You may have to override additional targets to avoid errors.

Adam Fyles
  • 6,030
  • 1
  • 23
  • 29
  • This was the key for me-- I was able to fix by adding Thanks – antlersoft Jun 15 '11 at 20:58
  • 1
    If this solved you problem, why didn't you then mark this answer? – Bojan Bjelic Oct 31 '11 at 15:27
  • Having added to my .csproj file, I am now getting this error: Unable to copy file "obj\Release\MyProject.dll" to ".\MyProject.dll". Could not find file 'obj\Release\MyProject.dll' It looks like the project is still attempting to copy the assembly to the Output Path in the project properties. What else needs doing to stop this? – Laurence Jan 05 '12 at 16:02
1

At the top of the file you have the DefaultTargets="Build"

Change "Build" to "call_targets" and you should be good to go.

Reza
  • 181
  • 1
  • 6
0

A quick fix for this would be to add a dummy page to the project. The build would work after that.

matthias krull
  • 4,389
  • 3
  • 34
  • 54
Pratik
  • 1
0

What is inside "common.web.targets"? I assume that the error is generated from a target in that file (or another that it imports).

Sayed Ibrahim Hashimi
  • 43,864
  • 17
  • 144
  • 178