VS2017解决方案的常见app.json文件,其中包含许多项目。如何参考和找到通用配置文件

时间:2018-12-05 21:10:01

标签: c#

我有一个由许多项目组成的VS2017解决方案。这些项目大多数是单独的可执行文件,将被安排为单个作业可执行文件。 1个项目是一个Web应用程序,而1个项目是一个存储配置信息的库。我希望所有项目共享映射到刚才提到的库的相同配置文件。我应该在哪里将填充库的app.json文件放在配置类中?以及如何引用该文件?当前,它使用当前目录,但是每个可执行文件在构建结构中都有不同的目录。该库的定义如下。

def label3(itse, teksti, koko, väri, sijaintix, sijantiy):
    font = pygame.font.SysFont("ubuntu-regular", koko)
    itse.screen.blit(font.render(teksti, True, väri), (sijantix, sijantiy)) #im pretty sure this is the problem.
    pygame.display.update()
    ruoka = 1
    juoma = 1
    energia = 1
    viihde = 1
def reset():
    cls()
    label("Olet aasi, mitä haluat tehdä?", 30, (255, 255, 0), 300, 50)
    label("Paina 1 syödäksesi." , 20, (255,255,0), 300, 80)
    label("Paina 2 juodaksesi" , 20, (255,255,0), 300, 100)
    label("Paina 3 juostaksesi" , 20, (255,255,0), 300, 120)
    label("Paina 4 nukkuaksesi" , 20, (255,255,0), 300, 140)
    label("Paina esc poistuaksesi" , 20, (255,255,0), 300, 160)
    rect = pygame.draw.rect(screen, (0, 0, 0), (0, 240, 900, 100)) # this rectangle is the "status"
    label3(rect, "ruoka: " + str(ruoka), 35, (255, 255, 255), 40, 250) #these ones are suooised to be in the rectangle "status"
    label3(rect, "juoma: " + str(juoma), 35, (255, 255, 255), 40, 250) # ^
    pygame.display.update()

编辑1- 我已经将app.json文件链接到所有项目,但是在运行单个项目时仍然找不到文件错误。如果我复制文件,效果很好。

0 个答案:

没有答案