In visual studio, I’ve created a project that’s .NET7, then changed the target to net48;net7.0-windows
but when i try to compile, I’m getting a bunch of errors saying namespace name 'Grasshopper'
not found, if I only target net48
it compiles fine.
I followed the instructions here:
in the video, they were able to compile while targeting both 4.8 and 7 without encountering this error? Any ideas why?
my csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net7.0-windows</TargetFrameworks>
<LangVersion>11</LangVersion>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>Test</AssemblyTitle>
<Product>Test</Product>
<Copyright>Copyright © 2024</Copyright>
<AssemblyVersion>0.1.0</AssemblyVersion>
<FileVersion>0.1.0.0</FileVersion>
<TargetExt>.gha</TargetExt>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Grasshopper" Version="7.28.23058.3001" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
The error:
Severity | Code | Description | Project | File | Line | Suppression State | Details |
---|---|---|---|---|---|---|---|
Error | CS0246 | The type or namespace name ‘Grasshopper’ could not be found (are you missing a using directive or an assembly reference?) | Test (net7.0-windows) | D:\Repo\Test\src\GlobalUsing.cs | 1 | Active |