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

T4 Run Tool errors with Compiler Transform Errors after installing VS2019 and SDK3.1 #10701

Open
brcaswell opened this issue Feb 22, 2020 · 4 comments
Labels

Comments

@brcaswell
Copy link

The project(s) uses multi-target <TargetFrameworks>netstandard2.0;netcoreapp2.2;net461</TargetFrameworks>

The T4 transformation compiled without error with VS2017 and SDK2.1 (could have been SDK2.2 actually) with MSBuild in visual studio. (I don't recall doing dotnet msbuild in this repo)

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0116	A namespace cannot directly contain members such as fields or methods	EmpyrionNetAPIModBase (net461), EmpyrionNetAPIModBase (netcoreapp2.2), EmpyrionNetAPIModBase (netstandard2.0)	E:\gitrepos\EmpyrionNetAPIAccess\EmpyrionNetAPIModBase\Autowire.ModBase.APIRequestsDefinition.cs	1	Active
Error		Compiling transformation: The type 'List<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.	EmpyrionNetAPIBroker	E:\gitrepos\EmpyrionNetAPIAccess\EmpyrionNetAPIBroker\Autowire.Broker.APIRequestsDefinition.tt	28	
Error		Compiling transformation: The type 'Dictionary<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.	EmpyrionNetAPIBroker	E:\gitrepos\EmpyrionNetAPIAccess\EmpyrionNetAPIBroker\Autowire.Broker.APIRequestsDefinition.tt	29	
Error		Compiling transformation: The type 'Type' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.	EmpyrionNetAPIBroker	E:\gitrepos\EmpyrionNetAPIAccess\EmpyrionNetAPIBroker\Autowire.Broker.APIRequestsDefinition.tt	181	

Project is at GitHub - EmpyrionNetAPIAccess


Apart from creating this issue workitem on this observation, I would also like some feedback on using global.json option to specify an earlier sdk, and whether VS2017 \ VS2019 will honor that. I've read some information on the matter, but would like feedback\clarification on the steps and considerations.

@brcaswell
Copy link
Author

note: If I remove netstandard2.0 and netcoreapp2.2 from the project targets it will run and generate.

@brcaswell
Copy link
Author

brcaswell commented Feb 22, 2020

Workaround: adding assembly reference to netstandard.dll
<#@ assembly name="C:\Program Files\dotnet\sdk\3.1.101\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\netstandard.dll" #>

works with 2.2.108, 2.1.511 and $(NETCoreSdkVersion) reference as well, respectfully...

which raises the question, which prop do I use to ensure the latest SDK version is used here (in respect to distribute source and all)? and of course, why is this necessary?

@brcaswell
Copy link
Author

brcaswell commented Feb 22, 2020

issue seems to relate to dotnet/standard#542 and can probably be closed in that respect

@brcaswell
Copy link
Author

note that removing multi-target, using <TargetFramework>netstandard2.0</TargetFramework> without the workaround fails, and doesn't seem related to the other (latest) referenced issue ("... stomp on each other for Multiple TFMs") that is milestoned to 5.0.1xx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants