Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
franckster
Frequent Visitor

Visual Studio (Code & 2017 Community) .NETFramework error

Hi all,
I'm reaching out because I'm bumping into a problem that prevents me to try out all the PowerBI sample applications in either VS Code or VS 2017 Community.
I'm totally new to the .NET / C# Windows world as I've developped on the RoR Stack on Ubuntu so far.
When I try and run code like the App Owns Data sample, I get the following error in the console :
d:\Code\Embed-API-Sample\EmbedAPISample\EmbedAPISample.csproj : error NU1202: Package Microsoft.PowerBI.Api 2.0.11 is not compatible with net40 (.NETFramework,Version=v4.0). Package Microsoft.PowerBI.Api 2.0.11 supports: portable-net45+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile111)
d:\Code\Embed-API-Sample\EmbedAPISample\EmbedAPISample.csproj : error NU1202: Package Microsoft.Rest.ClientRuntime 2.0.1 is not compatible with net40 (.NETFramework,Version=v4.0). Package Microsoft.Rest.ClientRuntime 2.0.1 supports:
d:\Code\Embed-API-Sample\EmbedAPISample\EmbedAPISample.csproj : error NU1202: - dnxcore50 (DNXCore,Version=v5.0)
d:\Code\Embed-API-Sample\EmbedAPISample\EmbedAPISample.csproj : error NU1202: - net45 (.NETFramework,Version=v4.5)
d:\Code\Embed-API-Sample\EmbedAPISample\EmbedAPISample.csproj : error NU1202: - portable-net45+win8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile111)

It looks like the .NET 4.0 Framework is referenced somewhere but I can't find where. And it's not installed on my PC as I went for the 4.7.1 version on my Win10 Creators' etc PC.

I'd really appreciate if anyone could help...

Thanks forward for any ressource you will direct me to,

Best,

Franck

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @franckster,

 

Here is an article about troubleshooting .NET Framework Targeting Errors. Could you go to check if it helps in your scenario? Smiley Happy

 

Regards

Thanks for your answer!

I had the PBI support over the phone on Friday and the build went fine on VS Community 2017 when we downloaded again the source code from Github. So I assume opening the project in VS Code first kind of messed it up...

I'll look into it anyway as it really bugs me not be be able to use VS Code for this...

Thanks again !

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.