You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
CS1061 error shows when we build OrchardCore\src\OrchardCore.Modules\OrchardCore.Taxonomies project with dotnet-sdk-9.0.100-preview.3.24175.24
Repro steps The machine has dotnet-sdk-9.0.100-preview.3.24175.24 installed
Copy app source to local machine
In Cmd, go to directory: OrchardCore\src\OrchardCore.Modules\OrchardCore.Taxonomies
dotnet build
Expected Result: Build successfully. Actual Result:
OrchardCore\src\OrchardCore.Modules\OrchardCore.Taxonomies\Controllers\AdminController.cs(145,56): error CS1061: 'JObject' does not contain a definition for 'Terms' and no accessible extension method 'Terms' accepting a first argument of type 'JObject' could be found (are you missing a using directive or an assembly reference?)
internal class Program
{
static void Main(string[] args)
{
ContentItem item = new ContentItem();
var dat = MyTest(item.As<ContentPart>().Content);
var items = dat.MyProperty as JArray;
}
private static JObject MyTest(JObject content)
{
throw new NotImplementedException();
}
}
public class ContentElement
{
public JObject Data { get; internal set; }
public dynamic Content { get { return Data; } }
}
public class ContentPart : ContentElement
{
}
public static class ContentItemExtensions
{
public static TPart As<TPart>(this ContentItem contentItem) where TPart : ContentPart => contentItem.Get<TPart>(typeof(TPart).Name);
}
public class ContentItem
{
internal TPart Get<TPart>(string name) where TPart : ContentPart
{
throw new NotImplementedException();
}
}
Build source code with "dotnet build" using 9.0.100-preview.3.24175.24 SDK
Expected Result: Build successfully. Actual Result:
error CS1061: 'JObject' does not contain a definition for 'MyProperty' and no accessible extension method 'MyProperty' accepting a first argument of type 'JObject' could be found (are you missing a using directive or an assembly reference?)
dotnet info:
C:\Users\v-gwei>dotnet --info
.NET SDK:
Version: 9.0.100-preview.3.24175.24
Commit: 09d6f381e6
Workload version: 9.0.100-manifests.77bb7ba9
MSBuild version: 17.10.0-preview-24175-03+89b42a486
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-preview.3.24175.24\
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 9.0.0-preview.3.24172.9
Architecture: x64
Commit: 9e6ba1f68c
.NET SDKs installed:
9.0.100-preview.3.24175.24 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.0-preview.3.24172.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.0-preview.3.24172.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 9.0.0-preview.3.24175.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
@marcpopMSFT Could you please help check this issue and confirm if it is a blocker for .NET 9 Preview3? Please help move to the correct team if it is incorrect. Thanks.
Application Name: OrchardCore
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.3.24175.24
App Source Location checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2012346
Github Link: https://github.com/OrchardCMS/OrchardCore
Verify Scenarios:
Description:
CS1061 error shows when we build OrchardCore\src\OrchardCore.Modules\OrchardCore.Taxonomies project with dotnet-sdk-9.0.100-preview.3.24175.24
Repro steps
The machine has dotnet-sdk-9.0.100-preview.3.24175.24 installed
Expected Result: Build successfully.
Actual Result:
Minimal Repro steps (Demo attached):
ConsoleApp9.zip
The machine has dotnet-sdk-9.0.100-preview.3.24175.24 installed.
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
dotnet build
" using 9.0.100-preview.3.24175.24 SDKExpected Result: Build successfully.
Actual Result:
dotnet info:
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: