Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet compile check if source file exists before precompile event #5137

Closed
enricosada opened this issue Feb 18, 2016 · 2 comments
Closed

dotnet compile check if source file exists before precompile event #5137

enricosada opened this issue Feb 18, 2016 · 2 comments
Milestone

Comments

@enricosada
Copy link
Contributor

I generate some source files in the precompile event (using a tool), but atm i need to add a placeholder file (empty it's ok) because dotnet compile check if all source file exists before calling precompile (ref source).

In the example below, a Generated.cs placeholder is needed because otherwise i get the error:

Compiling gensource for DNXCore,Version=v5.0
Can't find file Generated.cs

If i create an empty Generated.cs, everything it's ok

An example ( replace a dotnet new with this project.json )

{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true
    },

    "compileFiles": [
        "Generated.cs",
        "Program.cs"
    ],

    "scripts": {
        "precompile": [
            "cmd /c echo namespace Gen { class GenClass { } } > Generated.cs"
        ],
    },

    "dependencies": {
        "NETStandard.Library": "1.0.0-rc2-23811"
    },

    "frameworks": {
        "dnxcore50": { }
    }
}
@enricosada
Copy link
Contributor Author

I think that's annoying because the precompile event it's useful to to create and use generated files (like a dotnet-tt tool).

If it's ok, i can implement the fix

@ncthbrt
Copy link

ncthbrt commented Jun 30, 2016

I'm building a dotnet cli extension which is affected by this issue. Is there any word as to whether this is planning on being fixed?

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the Backlog milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants