Comments (9)
Interesting.
I will look into it. For the time being, to get your intellisense back, I suggest downloading an evaluation version of ReSharper 7 (which does get it right, that's why I haven't noticed the problem myself).
from saltarellecompiler.
When i tried to install Santarelle runtimes into GAC, it gave an error as DLL's are targeted for a newer framework. I checked in ILSPY and it also shows your mscorlib runtime version as 4.0. When i set project to 4.0 runtime, this time, it complains about System.dll reference missing etc. Don't know if it is related, but might help.
from saltarellecompiler.
You can't install saltarelle runtimes into the GAC, since they use a non-standard mscorlib.
And the Saltarelle mscorlib version is 1.1.
from saltarellecompiler.
Visual Studio seems to have a "feature" that makes intellisense for mscorlib unusable unless the standard Microsoft.CSharp.targets is included in the build.
Actually, it seems that the rule is that the Csc task must be invoked with the correct arguments at the correct point in the build (where the exact definition of correct is unknown to me, but just inserting a dummy call does not help).
For the time being, I recommend using ReSharper, which doesn't have this "feature", and I guess I'll have to contact the VS team at Microsoft to get help with the issue.
from saltarellecompiler.
MSDN forum link: http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/cdcb3eac-8044-446e-b585-834e8d8214f8
from saltarellecompiler.
By some trial and error, i changed your .targets file as below, and it works now:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<UsingTask AssemblyFile="SCTask.dll" TaskName="SCTask"/>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.cs</DefaultLanguageSourceExtension>
<Language>C#</Language>
<EmitDebugInformation>false</EmitDebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(DebugType)'=='pdbonly' Or '$(DebugType)'=='full'">
<EmitDebugInformation>true</EmitDebugInformation>
</PropertyGroup>
<ItemGroup>
<IntermediateScript Include="$(IntermediateOutputPath)$(TargetName).js" Condition="'@(IntermediateScript)'==''"/>
</ItemGroup>
<Target Name="AfterCompile" DependsOnTargets="$(CoreCompile)"
Inputs="$(MSBuildAllProjects);
$(AssemblyOriginatorKeyFile);
@(Compile);
@(ReferencePath);
@(CustomAdditionalCompileInputs)"
Outputs="@(DocFileItem);
@(IntermediateScript);
@(IntermediateAssembly);
@(CustomAdditionalCompileOutputs)"
Returns="">
<SCTask AdditionalLibPaths="$(AdditionalLibPaths)"
DefineConstants="$(DefineConstants)"
DisabledWarnings="$(NoWarn)"
DocumentationFile="@(DocFileItem)"
EmitDebugInformation="$(EmitDebugInformation)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
OutputAssembly="@(IntermediateAssembly)"
OutputScript="@(IntermediateScript)"
References="@(ReferencePath);@(ReferenceDependencyPaths)"
Sources="@(Compile)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)"
WarningsNotAsErrors="$(WarningsNotAsErrors)"
/>
</Target>
<Target Name="CopyFilesToOutputDirectory">
<Copy SourceFiles="@(IntermediateAssembly)" DestinationFolder="$(OutDir)" />
<Copy SourceFiles="@(IntermediateScript)" DestinationFolder="$(OutDir)" />
</Target>
</Project>
from saltarellecompiler.
Unfortunately this compiles the code twice, which is something I want to avoid if at all possible.
The VS behaviour seems to be something like:
Intellisense starts working for a file the first time that file is compiled with the Csc task producing the @(IntermediateAssembly) output.
Once Intellisense has started working for a file, it will keep working forever.
Just because one file in the project works, it doesn't mean that other files in the same project will. Each file has to be a source to the Csc task before that file will start working.
Restarting VS does not cause Intellisense to stop working for files it is already working for.
I would LOVE to see the VS code behind this behavior.
from saltarellecompiler.
I don't know anything about how these .targets files or Visual Studio build process works.
I took a look at how ScriptSharp and VannatechBlade .targets file is written, and they both use AfterCompile target.
Not sure why your SCTask compiles code again? AFAIK, ScriptSharp's ScriptCompilerTask doesn't compile code. Just reuses already compiled IntermediateAssembly (maybe not even that), source, and project files.
from saltarellecompiler.
I do that for two reasons:
- I want the task to be self-contained, so the build doesn't rely on third-party task to also be called (passing invalid code to the script compilation will give you internal errors), and
- I had the idea (now abandoned or at least put on hold) that the compiler should annotate the output assembly with eg. [ScriptName] attributes to ensure that overload resolution works across assemblies (don't worry, it still does work, I decided to use a deterministic naming algorithm instead).
Obviously neither of these reasons are more important than working VS IntelliSense, so I should change this (I will add an extra task parameter to the SCTask that tells it not to build the output assembly). But it was a VS feature that was hard to foresee.
from saltarellecompiler.
Related Issues (20)
- [2.6.2] Canceled tasks should throw TaskCanceledException instead of InvalidOperationException HOT 3
- Status? HOT 1
- [2.6.2] Combining async, finally and IList/IEnumerable results in an incorrect execution workflow HOT 3
- Bridge.NET Acquires Saltarelle HOT 54
- Boolean XORs generate incorrect result HOT 1
- Non-serializable properties for serializable types HOT 1
- int.Parse() gets translated to parseInt(), which isn't precise HOT 4
- Bug in inheritance? HOT 3
- INTERNAL ERROR: ResolveResult ConversionResolveResult HOT 6
- Add support for InternalsVisibleTo attribute HOT 3
- [2.7.0] Asynchronous tasks swallow exceptions
- Minifier incorrectly minifies '+ ++' into '+++'
- When using [NamedValuesAttribute] on an enum, that enum's values are not compiled correctly when used as default parameters HOT 3
- If the data exict HOT 1
- Saltarelle.Runtime HOT 1
- Saltarelle rewrites Mixing expression $.expr[':'] to $["expr[':']"] HOT 1
- Provide toString override for Exception class, otherwise uncaught exceptions will end up logged as [object Object]
- ss_Int32.tryParse returns 0 when value can't be parsed (when input does not match regexp)
- Dictionary issue on Chrome HOT 3
- Saltarelle.Compiler 2.7.0 - INTERNAL ERROR: System.TypeLoadException
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 saltarellecompiler.