Skip to content

won't build #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kongomongo opened this issue Dec 15, 2024 · 6 comments
Open

won't build #1

kongomongo opened this issue Dec 15, 2024 · 6 comments

Comments

@kongomongo
Copy link

hi there, can you elaborate on the requirements?

I tried installing this on debian 12, using dotnet-sdk-9.0

using dotnet restore and dotnet run I get:

Using launch settings from /root/Real-Time-Stock-Tracker/Properties/launchSettings.json...
Building...
/root/Real-Time-Stock-Tracker/Services/StockService.cs(1,20): error CS0234: The type or namespace name 'Net' does not exist in the namespace 'AlphaVantage' (are you missing an assembly reference?)
/root/Real-Time-Stock-Tracker/Services/StockService.cs(31,48): error CS0246: The type or namespace name 'StockTimeSeries' could not be found (are you missing a using directive or an assembly reference?)
/root/Real-Time-Stock-Tracker/Services/StockService.cs(36,38): error CS0246: The type or namespace name 'StockTimeSeries' could not be found (are you missing a using directive or an assembly reference?)
/root/Real-Time-Stock-Tracker/Services/StockService.cs(9,26): error CS0246: The type or namespace name 'StockClient' could not be found (are you missing a using directive or an assembly reference?)

manually dotnet add package AlphaVantage.Net.Stocks reduces this to:

Using launch settings from /root/Real-Time-Stock-Tracker/Properties/launchSettings.json...
Building...
/root/Real-Time-Stock-Tracker/Services/StockService.cs(9,26): error CS0246: The type or namespace name 'StockClient' could not be found (are you missing a using directive or an assembly reference?)

The build failed. Fix the build errors and run again.

Are you using a specific version of AlphaVantage.Net.Stocks ?

Thanks in advance!

@nickssilver
Copy link
Owner

Hi there,

Thank you for reaching out and providing the details. It looks like there are a few issues that need to be addressed to get the project running smoothly.

  1. Version Compatibility: The project is using .NET 8.0, but you are trying to install it with .NET SDK 9.0. While .NET 9.0 should generally be backward compatible, it's a good idea to ensure you are using the same version as the project. You can install .NET 8.0 SDK by running:
sudo apt-get update
sudo apt-get install dotnet-sdk-8.0
  1. Assembly References: The errors you're encountering suggest that the necessary packages are not correctly referenced. You mentioned that adding AlphaVantage.Net.Stocks reduced the errors, but there are still issues with StockClient. Ensure you have the correct version of the package. You can specify the version in your csproj file or use the dotnet add package command with the version number:
dotnet add package AlphaVantage.Net.Stocks --version 
  1. Using Directives: Make sure you have the correct using directives at the top of your StockService.cs file. For example:
using AlphaVantage.Net.Stocks;
using AlphaVantage.Net.Stocks.Client;
using AlphaVantage.Net.Stocks.Models;

Project Configuration: Ensure that your project file (Real-Time-Stock-Tracker.csproj) includes the necessary package references. It should look something like this:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="AlphaVantage.Net.Stocks" Version="1.0.0" />
  </ItemGroup>
</Project>

Rebuild the Project: After making these changes, try running the following commands to restore and build the project:

 `` dotnet restore
  dotnet build

``

If you continue to encounter issues, please provide the specific version of AlphaVantage.Net.Stocks you are using, and any additional error messages. This will help in diagnosing the problem more accurately.

Thanks in advance for your cooperation!

@kongomongo
Copy link
Author

Thanks for the prompt reply. I'm sorry but your post has a couple strange things in them, that I can't follow.

First of all, dotnet add package AlphaVantage.Net.Stocks --version needs a package version, which version is the correct one?
NuGet only lists 2 versions, 2.0.1 and 2.0.2 https://www.nuget.org/packages/AlphaVantage.Net.Stocks/

using AlphaVantage.Net.Stocks;
using AlphaVantage.Net.Stocks.Client;
using AlphaVantage.Net.Stocks.Models;

this is not part of the source code so I am not sure if that is intended or not?

Anyways, aside from your suggestions I checked the repo https://github.com/kirlut/AlphaVantage.Net and it seems like this does not match the code you are using.

You are spawning the client via new StockClient(_apiKey); but the github says to use

using var client = new AlphaVantageClient(apiKey);
using var stocksClient = client.Stocks();

so I am not really sure how this repo can function without changes?

@nickssilver
Copy link
Owner

I want to clarify that the code you are working with is the very first version I published, which means it is still incomplete. As a result, there are several components and features that are currently missing.

I appreciate your understanding and will work to provide a more complete and functional version as soon as possible.

@kongomongo
Copy link
Author

kongomongo commented Dec 15, 2024

I get that and I have no problem helping, but it appears to me that the current code either
a) cannot compile
or
b) needs different prerequisites than I am using.

@kongomongo
Copy link
Author

I created this #2

@nickssilver
Copy link
Owner

you're welcomed to contribute to the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants