none
Visual studio application dont run on another computer

    Question

  • hello i have a problem, my c# application wont run on my another Computer without visual studio installed.
    I used .net 4.5.2 , metro UI and entity Framework  for my db.
    When i try to run my .exe on another Computer, application run in task manager but the forms dont show up.
    I have Windows 10 and the application was maked in Visual Studio 2015.

    I try it with WIX, visual studio installer and with defoult publich tool in visual but noting changed my situation

    Win 10 have .net 4.6 Framework installed by defoult and i installed .net 4.5.2 and 4.6.2 sdk

    http://prntscr.com/ee67x4

    and on this picture u can see my runned app in task manager and noting on screen:

    http://prntscr.com/ee69co

    i think the metro UI make problems then i tryed to run diferent app without metro ui and its work good,

    PLS help me ....

    Monday, February 27, 2017 10:02 PM

All replies

  • and in my publich setup i included all dll file
    Monday, February 27, 2017 10:04 PM
  • Are you sure you want to create a Metro type application? If so, be aware that the recommended way of deploying Metro applications is through the Microsoft store.

    You can try to deploy using a App Package, but I'm not sure if that can be done for applications meant to be released. See this article Deploy Windows Store apps from Visual Studio for details.

    Also see if this article is of use to you.

    Monday, February 27, 2017 10:28 PM
  • i foundout that the metro UI is not the problem, my mdf database is the problem...

    the error is : error 50 local database runtime error occurred. the sprcified localDB instacnce does not exits

    picture:

    http://prntscr.com/ee7fh4

    i installed the Microsoft sql server 2012 express LocalDB and the error 50 shows up like in the picture, but without the sql installation the error 52 shows up

    What i need to install if i have a app with localDB mdf maked in visual studio?

    Monday, February 27, 2017 11:53 PM
  • i foundout that the metro UI is not the problem, my mdf database is the problem...

    the error is : error 50 local database runtime error occurred. the sprcified localDB instacnce does not exits

    picture:

    http://prntscr.com/ee7fh4

    i installed the Microsoft sql server 2012 express LocalDB and the error 50 shows up like in the picture, but without the sql installation the error 52 shows up

    What i need to install if i have a app with localDB mdf maked in visual studio?

    Excellent troubleshooting. So probably your connection string is wrong. Did you set it up as a file?

    Introducing LocalDB, an improved SQL Express

    • Edited by Brian Muth Tuesday, February 28, 2017 12:16 AM
    Tuesday, February 28, 2017 12:13 AM
  • Yes it is a file in my visual studio, but the connection string is ok because the app runs normal on my any computer with a visual studion istalled ...

    picture of my solution explorer:

    http://prntscr.com/ee7pkv

    u can see the mdf file 

    Tuesday, February 28, 2017 12:23 AM
  • Yes it is a file in my visual studio, but the connection string is ok because the app runs normal on my any computer with a visual studion istalled ...

    picture of my solution explorer:

    http://prntscr.com/ee7pkv

    u can see the mdf file 


    It's ok on YOUR machine, but not ok on the target machine. Find out why. I tend to use SQL Server Management Studio for debugging these types of problems. You still haven't shown us your connection string.
    Tuesday, February 28, 2017 3:19 AM
  • <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <configSections>
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
      </configSections>
      <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
      </startup>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>
      <connectionStrings>
          <add name="Model1" connectionString="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\BazaPodataka.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"
              providerName="System.Data.SqlClient" />
      </connectionStrings>
    </configuration>

    Tuesday, February 28, 2017 10:05 AM
  • this is my app.config and the conn string :

     <add name="Model1" connectionString="data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\BazaPodataka.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"
              providerName="System.Data.SqlClient" />

    Tuesday, February 28, 2017 10:06 AM
  • but i dont understand why this app works on any computer with visual studio installed on it, we try it on 4 diferent computers and it work good but on other computer without visual noting :(

    Tuesday, February 28, 2017 10:10 AM
  • Hi friend,

    Welcome to MSDN forum.

    >>i dont understand why this app works on any computer with visual studio installed on it, we try it on 4 diferent computers and it work good but on other computer without visual noting :(

    Most applications have prerequisites: Components such as the .NET Framework runtime must be available on a target computer in order for the application to run. In your case, you need to check if you have added Prerequisites of .NET Framework in Visual Studio Setup Project, or making sure the computer which without visual studio has installed the corresponding .NET Framework.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 01, 2017 7:52 AM