+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Error when trying to run samples in browser

Error when trying to run samples in browser

3 posts, 0 answered
  1. Bo Chulindra
    Bo Chulindra avatar
    35 posts
    Registered:
    17 Dec 2013
    03 Jan 2014
    Link to this post
    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]
  2. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    08 Dec 2016
    08 Jan 2014
    Link to this post
    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
  3. Bo Chulindra
    Bo Chulindra avatar
    35 posts
    Registered:
    17 Dec 2013
    09 Jan 2014 in reply to Sabrie Nedzhip
    Link to this post
    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.
3 posts, 0 answered