-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Scripty doesn't work in SDK-style projects #120
Comments
I can confirm Scripty can work with SDK projects that target .NET Framework. Not sure about the custom tool, but I've gotten the MSBuild task up and running on several SDK projects. It's really strange that it's looking for an Perhaps there is a difference between building with Work on these types of issues is ongoing (though it may not seem like it from the commits). Scripty will be undergoing a major overhaul to target .NET Standard soon. Right now the work is happening in the Buildalyzer repo. That will give Scripty a new foundation for compiling any project type on any platform and it's almost done. Then Scripty will be rewritten to use Buildalyzer and go all-in on the new stuff. It's taking a little bit of time to work everything out - there are so many hidden pitfalls, especially since build tools like Scripty are kind of pushing the envelope. Hang tight. |
Thanks for your answer.
I just noticed something strange: it doesn't build in Visual Studio, but it works when I invoke MSBuild from the command line... Not sure what's going on. |
It is even weirder. I got it to work initially in Visual Studio, but my third build failed with the message above. |
Its not specific to scripty i dont think... |
Scripty appears to work fine when compiling .NET Core projects in Visual Studio, however as alluded to by @daveaglick when compiling with dotnet.exe it explodes trying to load .NET Framework specific assemblies such as Since all Scripty.MsBuild.Targets <Project>
<PropertyGroup>
<ScriptyVersion>0.7.4</ScriptyVersion>
<ScriptyExe>$(NuGetPackageRoot)scripty.msbuild\$(ScriptyVersion)\tools\Scripty.exe</ScriptyExe>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Scripty.MsBuild" Version="$(ScriptyVersion)" PrivateAssets="all">
<ExcludeAssets>build</ExcludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="EvaluateScriptyFiles" BeforeTargets="DispatchToInnerBuilds">
<Exec Command=""$(ScriptyExe)" "$(MSBuildProjectFullPath)" @(ScriptyFiles->'"%(Identity)"', ' ') -p Configuration=$(Configuration)" StandardOutputImportance="low" />
</Target>
</Project> Project.csproj <Project Sdk="Microsoft.NET.Sdk">
<Import Project="Scripty.MsBuild.targets" />
<ItemGroup>
<ScriptyFiles Include="File.csx" />
<Compile Include="File.cs" Visible="false" />
</ItemGroup>
</Project> This configuration also prevents Scripty from tripping over itself when building multiple target frameworks (as a result of being evaluated before |
Just a quick note to tidy up using GeneratePathProperty Scripty.MsBuild.Targets
|
When the project is in the new .NET Core csproj format ("SDK-style" project), the custom tool doesn't work. There's no error, but nothing is generated.
The Scripty.MSBuild package doesn't work either; the build fails with this error:
Sample project that demonstrates both issues:
The text was updated successfully, but these errors were encountered: