C
C#2y ago
annoyingb

✅ .net trying to find non-existent cs files

Error IDE1100 Error reading content of source file 'D:\Dev\C++\Test\TestCS\obj\Debug\net6.0\.NETCoreApp,Version=v6.0.AssemblyAttributes.cs' -- 'Could not find file 'D:\Dev\C++\Test\TestCS\obj\Debug\net6.0\.NETCoreApp,Version=v6.0.AssemblyAttributes.cs'.'. AndromedaCS D:\Dev\C++\Test\TestCS\obj\Debug\net6.0\.NETCoreApp,Version=v6.0.AssemblyAttributes.cs 1 Active I am getting this error though my build directory is outside of the TestCS project. I am building it as a dll and it keeps trying to find AssemblyAttributes.cs and AssemblyInfo.cs and GlobalUsings.cs etc and I don't know why. I am using 4.7.2.
32 Replies
Monsieur Wholesome
C# isnt C++ FYI Show us your projects folder
annoyingb
annoyingbOP2y ago
oh i know i was trying to use c++ and c# using mono wdym
Jimmacle
Jimmacle2y ago
what does this mean? you don't need mono to do C++ interop in C#
annoyingb
annoyingbOP2y ago
yeah but I didn't want to use pinvoke
Jimmacle
Jimmacle2y ago
what's your other option, C++/CLI?
annoyingb
annoyingbOP2y ago
yeah using mono
Jimmacle
Jimmacle2y ago
which is no longer supported in newer versions of .NET afaik
annoyingb
annoyingbOP2y ago
i want to call a c++ function from c#
Jimmacle
Jimmacle2y ago
just use pinvoke imo you're overcomplicating it
annoyingb
annoyingbOP2y ago
i want to use mono i don't want to use pinvoke
Jimmacle
Jimmacle2y ago
are we missing context? are you trying to execute C# code from a C++ entry point? this I am using 4.7.2. also doesn't match up with .NETCoreApp,Version=v6.0
annoyingb
annoyingbOP2y ago
yeah ik and i don't know why
Jimmacle
Jimmacle2y ago
why don't you want to use pinvoke?
annoyingb
annoyingbOP2y ago
i just don't want to?
Jimmacle
Jimmacle2y ago
whatever you're trying to do instead seems way more complicated so if you don't have a good reason to not use it, my recommendation is just use it
annoyingb
annoyingbOP2y ago
pinvoke uses c and i don't have any c code
Jimmacle
Jimmacle2y ago
pinvoke does not "use c"
annoyingb
annoyingbOP2y ago
i have to have an extern "c"
Monsieur Wholesome
mono and pinvoke are completely unrealted
annoyingb
annoyingbOP2y ago
to access anything yeah i know
Jimmacle
Jimmacle2y ago
i don't think you even need to export the functions like that, you'd just have to deal with name mangling on the C# side
Monsieur Wholesome
You seemingly are wanting to host the .net runtime from within C++
annoyingb
annoyingbOP2y ago
so how do I solve my problem?
Monsieur Wholesome
Show me your folder where your csproj is D:\Dev\C++\Test\TestCS
annoyingb
annoyingbOP2y ago
Monsieur Wholesome
whats inside Test
annoyingb
annoyingbOP2y ago
Kouhai
Kouhai2y ago
@youdontknowwhoiam What's your current VS version?
annoyingb
annoyingbOP2y ago
2022
Pobiega
Pobiega2y ago
and the content of the .csproj file?
annoyingb
annoyingbOP2y ago
when I deleted the csproj file and generated it again it worked i tried this before and it didn't work but it works now
Want results from more Discord servers?
Add your server