Giter VIP home page Giter VIP logo

Comments (4)

kzu avatar kzu commented on July 17, 2024

Any chance you could try the latest 3.0.0 beta, which switches to a far better, source generator-based approach for C# when you're not customizing the namespace?

from gitinfo.

kzu avatar kzu commented on July 17, 2024

Also, could you check the generated file at the top? The template contains:

// <auto-generated />
#define $NamespaceDefine$
#pragma warning disable 0436

#if LOCALNAMESPACE
namespace _RootNamespace_
{
...

The replacement for $NamespaceDefine$ is:

      <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' != ''">$(_ThisAssemblyContent.Replace('$NamespaceDefine$', 'LOCALNAMESPACE'))</_ThisAssemblyContent>
      <_ThisAssemblyContent Condition="'$(ThisAssemblyNamespace)' == ''">$(_ThisAssemblyContent.Replace('$NamespaceDefine$', 'GLOBALNAMESPACE'))</_ThisAssemblyContent>

Therefore, if ThisAssemblyNamespace where empty, it would cause the define to not contain the LOCALNAMESPACE value required for the namespace ... { to be considered by the compiler.

So, even if we do have an unconditional replace with the property value with:

      <_ThisAssemblyContent>$(_ThisAssemblyContent.Replace('_RootNamespace_', '$(ThisAssemblyNamespace)'))</_ThisAssemblyContent>

The Define should take care of the conditional compilation as needed 🤔

from gitinfo.

kzu avatar kzu commented on July 17, 2024

Perhaps a binlog + wrong .cs when it fails would help troubleshoot?

from gitinfo.

kzu avatar kzu commented on July 17, 2024

Closing for now due to inaction. Please reopen if you can provide a binlog or of this still fails on the latest version.

Thanks!

from gitinfo.

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.