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 migrate does not handle project.json embed behavior of the compiler/resources folder #7611

Closed
NTaylorMullen opened this issue Jan 27, 2017 · 4 comments

Comments

@NTaylorMullen
Copy link
Contributor

Steps to reproduce

// Note that if you look at the dll at this point the ShouldBeEmbedded.cs is embeded:
image

  • cd ../../
  • Remove the sdk from global.json
  • dotnet migrate
  • cd src/ProjectA
  • dotnet restore
  • dotnet build

Expected behavior

  • Compilation succeeds just as it did in project.json land.

Actual behavior

compiler\resources\ShouldBeEmbedded.cs(5,13): error CS0116: A namespace cannot directly contain members such as fields or methods [C:\Users\nimullen\Documents\GitHub\TEMP\src\ProjectA\ProjectA.csproj]
compiler\resources\ShouldBeEmbedded.cs(5,13): error CS0548: '<invalid-global-code>.CSharp': property or indexer must have at least one accessor [C:\Users\nimullen\Documents\GitHub\TEMP\src\ProjectA\ProjectA.csproj]
compiler\resources\ShouldBeEmbedded.cs(5,5): error CS0246: The type or namespace name 'INVALID' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\nimullen\Documents\GitHub\TEMP\src\ProjectA\ProjectA.csproj]

Notes

Another way you could solve this issue is re-implementing the compiler/resource behavior but I don't feel like that'd be the better than just handling this scenario in dotnet migrate.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc4-004616)

Product Information:
 Version:            1.0.0-rc4-004616
 Commit SHA-1 hash:  56d8071361

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Users\nimullen\AppData\Local\Microsoft\dotnet\sdk\1.0.0-rc4-004616
@livarcocc
Copy link
Contributor

@NTaylorMullen Migration only looks at your project.json when determining transformation and only apply transformation to your csproj.

What is your suggestion to handle this during dotnet migrate?

@NTaylorMullen
Copy link
Contributor Author

If there is a compiler/resources folder in the same directory as the project.json then have the csproj embed compiler/resources/**.

@livarcocc
Copy link
Contributor

livarcocc commented Jan 27, 2017

You mean generate a <EmbeddedResources Include="compiler/resources/*" />?

@NTaylorMullen
Copy link
Contributor Author

@livarcocc yes.

@jgoshi jgoshi self-assigned this Jan 27, 2017
@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the 1.0.0-rtm milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants