Comments (10)
#84 is not similar unfortunately. VS addin and source generator are using exactly the same runtime/code for compiling .nt.cs files. Theoretically the set of available assemblies should be the same, but environments are completely different VS is still on .net4.8, Rider probably on net.core. Your first thought was good, somehow source generator run by Rider is trying to do compilation targeting net.core, but all referenced assemblies are provided for net.standard, and I do not see any line that would tell compiler to explicitly target net.standard:
NTypewriter/NTypewriter.Runtime/UserCode/UserCodeLoader.cs
Lines 157 to 183 in 8c015cb
from ntypewriter.
Yea that certainly makes sense, Rider does seem to be trying to compile using Core even though when peeking at the assembly explorer it recognizes the NTypewriter.SourceGenerator assembly as .NET Standard v2... To confirm your theory I uninstalled the extension from VS and it still compiled just fine, so it's just a Rider issue.
from ntypewriter.
The problem may be in how assemblies are resolved for the compilation, in one of the future releases I will try to replace manually setting references to assemblies with this library:
https://github.com/jaredpar/basic-reference-assemblies
It looks promising, it should give more deterministic results, and hopefully the same results for VS/48 vs Rider/.core, but I wonder if it will work with Blazor .... but that is different story.
from ntypewriter.
Another interesting tidbit - I ran the source generator code through CI, and jenkins also failed to build it. Seeing that, I figured I'd try running it through VS via the terminal dotnet build command and it also failed, so there must be something very specific about what VS does when it builds that's different than the usual dotnet build?
Update: I then ran MSBuild from rider and it works. So it seems to be an MSBuild vs dotnet build issue.
It seems the issue is indeed core/framework. dotnet build is using this and fails (both locally and via CI):
MSBuild version 17.8.3+195e7f5a3 for .NET
while MSBuild uses this and works (in VS and Rider):
MSBuild version 17.8.5+b5265ef37 for .NET Framework
from ntypewriter.
Problem is fixed in NTypewriter.SourceGenerator v0.3.2
from ntypewriter.
Sweet I'll get it tested once the CI finishes. Cheers!
from ntypewriter.
Updated to the latest nuget packages for .Runtime and .SourceGenerator and still having compiling issues with MSBuild version 17.8.3+195e7f5a3 for .NET, I'll poke around and run the source code locally and see if I can get something working.
from ntypewriter.
That is impossible :D. The same error message? Did you delete obj and bin folders to make sure that something is not cached?
I was able to reproduce problem, and indeed there was difference between MSbuild for .NET vs .NET Framework, but using basic-reference-assemblies seems to resolved problem.
from ntypewriter.
I ran a clean, but didn't manually delete bin and obj, I can try that too :)
from ntypewriter.
I ran a clean, but didn't manually delete bin and obj, I can try that too :)
Yep same result after bin/obj delete and rebuild
from ntypewriter.
Related Issues (20)
- Changes from GIT not picked up by NTypewriter HOT 3
- This is perfect for AI
- Source Generator ArgumentNullException HOT 8
- Save function is misleading HOT 3
- `Microsoft.CodeAnalysis` not found HOT 10
- SourceGenerator can't find dependent projects HOT 2
- Publish latest releases as NuGet package HOT 4
- Template output preview is always displayed on top of everything HOT 1
- Template output preview with dark mode support
- Using C# 9.0 init accessors in a custom function gives an error inside Visual Studio extension HOT 1
- Extend AllReferencedTypes to search on Interfaces HOT 1
- Request - Property internal set vs public flag or filter HOT 3
- Action.Url does not support array-valued parameters HOT 1
- How to use builtin function LINQ.Where in template? HOT 7
- error while generating typescript services from ntypewriter runtime generator HOT 2
- Generic class with itself as argument of base type equality problem HOT 3
- How to join arrays without losing type information? HOT 2
- How to automatically render templates? HOT 2
- Incremental Generator HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntypewriter.