Coder Social home page Coder Social logo

Comments (5)

PulsarFX avatar PulsarFX commented on August 16, 2024 2

As I mentioned, this may not be a mono issue. I reproduced this in a pure Visual Studio 2019 environment using a .netStandard2.0 class library.

Microsoft Visual Studio Professional 2019
VisualStudio.16.Release/16.1.6+29102.190
Microsoft .NET Framework Version 4.7.03190

When you click "run custom tool" on the tt file you will find these two unsupported types:

  • global::System.CodeDom.Compiler.CompilerErrorCollection
  • global::System.Runtime.Remoting.Messaging.CallContext.LogicalGetData("sourceFile");

The first one can be added via the System.CodeDom nuget package.

ttSample.zip

from t4.

mhutch avatar mhutch commented on August 16, 2024

Which version is this with? How are you invoking it?

from t4.

PulsarFX avatar PulsarFX commented on August 16, 2024

I don't think it is related to mono.
This happens for me, when there is a parameter involved on a pure windows environment:

parent tt file has an include statement:

<#@ include file="..\some.ttinclude" #>

the included file defines a paramter:

<#@ parameter type="System.String" name="sourceFile" #>

which results in:

public override void Initialize()
{
	base.Initialize();
	if ((this.Errors.HasErrors == false))
	{
		bool sourceFileValueAcquired = false;
		if (this.Session.ContainsKey("sourceFile"))
		{
			this._sourceFileField = ((string)(this.Session["sourceFile"]));
			sourceFileValueAcquired = true;
		}
		if ((sourceFileValueAcquired == false))
		{
			object data = global::System.Runtime.Remoting.Messaging.CallContext.LogicalGetData("sourceFile");
			if ((data != null))
			{
				this._sourceFileField = ((string)(data));
			}
		}
	}
}

from t4.

mhutch avatar mhutch commented on August 16, 2024

That's very odd. The call to LogicalGetData is only emitted when FEATURE_APPDOMAINS is true:

And FEATURE_APPDOMAINS is only true for the net40 and net35 builds of the library:

<DefineConstants Condition="'$(TargetFramework)'!='netstandard2.0'">$(DefineConstants);FEATURE_APPDOMAINS</DefineConstants>

Can you give me a more complete repro case?

from t4.

mhutch avatar mhutch commented on August 16, 2024

Yes, that's using the T4 implementation in VS, not Mono.TextTemplating.

from t4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.