Error when trying to run samples in browser

Posted by Community Admin on 04-Aug-2018 19:36

Error when trying to run samples in browser

All Replies

Posted by Community Admin on 03-Jan-2014 00:00

I opened the SDK Browser and clicked "Run sample in browser" for Sitefinity Event Logger Module. A text editor opened up and I saw in it the following error:

C:\Users\Bo\AppData\Local\Telerik.Sitefinity.SDK\EventLogger_A57A84B\SitefinityWebApp\SitefinityWebApp.csproj(651,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

I checked to make sure Microsoft.WebApplication.targets exists in the location in the error and the file did not exist there. However, the file does exist if I change v10.0 to v11.0. I'm using Visual Studio Ultimate 2012 (version 11) so it makes sense to me that the files would exist in v11.0.

The error mentions a csproj file, so I opened it up and saw the following import line:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />

I manually changed the path to use v11.0 and it resolved the error. My question is: was the v10.0 path generated based on some environment variable on my machine? Or is it a problem with the sample itself?

Unfortunately, even though I got that specific error resolved, I still could not successfully run the sample in a browser.

After clicking on "Run sample in browser" again, the text file that opened up showed that the build succeeded but the following warnings were displayed and nothing was opened in my browser:

"C:\Users\Bo\AppData\Local\Telerik.Sitefinity.SDK\EventLogger_A57A84B\SitefinityWebApp\SitefinityWebApp.csproj" (default target) (2) ->
(ResolveAssemblyReferences target) ->
  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "payflow_dotNET". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Users\Bo\AppData\Local\Telerik.Sitefinity.SDK\EventLogger_A57A84B\SitefinityWebApp\SitefinityWebApp.csproj]

"C:\Users\Bo\AppData\Local\Telerik.Sitefinity.SDK\EventLogger_A57A84B\SitefinityWebApp\SitefinityWebApp.csproj" (default target) (2) ->
(CoreCompile target) ->
  CSC : warning CS1685: The predefined type 'System.Collections.Specialized.INotifyCollectionChanged' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll' [C:\Users\Bo\AppData\Local\Telerik.Sitefinity.SDK\EventLogger_A57A84B\SitefinityWebApp\SitefinityWebApp.csproj]

Posted by Community Admin on 08-Jan-2014 00:00

Hi Bo,

Could you please open the sample extraction folder and delete all the sample folders (except the Dependencies folder) and also delete the sample databases in the SQL Management Studio. Then please open the SDK sample in Visual Studio and run it in browser to see if you will continue experiencing the same issue.

Please also make sure that you have the Microsoft .NET Framework 4.0 installed on your machine as the Sitefinity SDK samples reference the .NET 4.0 version.

The problem is caused because when running a sample from the SDK in browser it by default tries to open it with visual studio 2010. With the above we aim to remove the reference for VS 2010 so the correct version of visual studio will be used to open a sample.

Regards,
Sabrie Nedzhip
Telerik

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 09-Jan-2014 00:00

Hi Sabrie,

I believe following your steps works for me. I deleted the sample projects and sample databases, then chose to open the project in Visual Studio first. Visual Studio then appears to migrate the project to use Visual Studio 2012. Then I launched the project from Visual Studio.

"Run sample In browser" still doesn't work for me though. If I click on "Run sample in browser" after opening the project in Visual Studio, nothing opens in my browser. The text editor that normally shows me errors does not appear though, so I'm not sure what the problem is. However, I'm okay with launching the sample from Visual Studio.

This thread is closed